Hello to everyone!!
I recently downloaded an asset UDP messenger and it looks quite good!I sent data to receive and so on!!!
But at the end of my project, I noticed something odd…(which is not after reading a lot on google)…
If the sending data device to my app stops sending then my app remains frozen with the last received values…
Of course, my next move is to add if received=“” do that and this but nothing.
After quit reading and debug log in certain places I noticed that the app stucks in the bytes received section and won’t budge until new data received…sad very sad… I need a way just simple text to notify the user that you are not receiving…is it possible???
Thank you so much!!
public void ReceiveData ()
{
while (true)
{
try
{
// Bytes received
IPEndPoint anyIP = new IPEndPoint(IPAddress.Any, 0);
byte[] data = client.Receive(ref anyIP);
// Bytes into text
string text = "";
text = Encoding.UTF8.GetString(data);
received = text;
}
catch (Exception err)
{
Debug.Log("Error:" + err.ToString());
}
}
}