unable to update the date property update the the date property
here is my code snippet where im facing issue
public DateTime LastReceivedImplicitMessage { get; set; }
var asyncResult = udpClientReceive.BeginReceive( new AsyncCallback(ReceiveCallbackClass1), s);
private void ReceiveCallbackClass1(IAsyncResult ar) { try {
UdpClient u = (UdpClient)((UdpState)(ar.AsyncState)).u;
if (udpClientReceiveClosed)
return;
u.BeginReceive(new AsyncCallback(ReceiveCallbackClass1), (UdpState)(ar.AsyncState));
System.Net.IPEndPoint e = (System.Net.IPEndPoint)((UdpState)(ar.AsyncState)).e;
Byte[] receiveBytes = u.EndReceive(ar, ref e);
// EndReceive worked and we have received data and remote endpoint
if (receiveBytes.Length > 20)
{
//Get the connection ID
uint connectionID = (uint)(receiveBytes[6] | receiveBytes[7] << 8 | receiveBytes[8] << 16 | receiveBytes[9] << 24);
if (connectionID == connectionID_T_O)
{
ushort headerOffset = 0;
if (T_O_RealTimeFormat == RealTimeFormat.Header32Bit)
headerOffset = 4;
if (T_O_RealTimeFormat == RealTimeFormat.Heartbeat)
headerOffset = 0;
for (int i = 0; i < receiveBytes.Length - 20 - headerOffset; i++)
{
T_O_IOData[i] = receiveBytes[20 + i + headerOffset];
}
//Console.WriteLine(T_O_IOData[0]);
}
}
LastReceivedImplicitMessage = DateTime.Now;
}
catch (Exception ex) { }
}
"LastReceivedImplicitMessage" is not getting updated with datetime.now