I'm using SharpOSC with Unity and when I close the UDPListener Unity freezes.
I fixed the problem by setting a timeout to ClosingEvent.WaitOne(timeout).
I don't know if it's good code but it seems to work now.
public void Close()
{
lock (callbackLock)
{
ClosingEvent.Reset();
closing = true;
receivingUdpClient.Close();
}
ClosingEvent.WaitOne(1000);
}
I'm using SharpOSC with Unity and when I close the UDPListener Unity freezes.
I fixed the problem by setting a timeout to ClosingEvent.WaitOne(timeout).
I don't know if it's good code but it seems to work now.