Hi, I’m trying to make a socket receive sensor data in real-time on ubuntu 20.04. But something weird happens. When I use the play button, the scene works ordinarily, but in the builded executable, the socket sporadically “waits” for the “receive”. It should receive the next message immediately because the sensor only uses the local network, and it does in the UnityEditor. My code looks something like this (just a simple socket program using a thread):
_clientReceiveThread = new Thread (new ThreadStart(ListenSensor));
_clientReceiveThread.IsBackground = true;
_clientReceiveThread.Start();
....
....
private voide ListenSensor()
{
_receivingUdpClient = new UdpClient(PortNumber);
IPEndPoint ipe = new IPEndPoint(IPAddress.Any, PortNumber);
byte[] receivedByteData = new byte[1024];
while(_isPlaying)
{
receivedByteData = _receivingUdpClient.Receive(ref ipe);
}
}
The thing that can be a hint is that it works fine when it is build on windows.
Does anybody knows how to solve this??