UnityOSC icon indicating copy to clipboard operation
UnityOSC copied to clipboard

ThreadAbortException

Open skullthug opened this issue 7 years ago • 3 comments

I'm noticing whenever I stop playing in the editor, this exception is always thrown:

ThreadAbortExceptionSystem.Threading.ThreadAbortException: Thread was being aborted at (wrapper managed-to-native) System.Net.Sockets.Socket:RecvFrom_internal (intptr,byte[],int,int,System.Net.Sockets.SocketFlags,System.Net.SocketAddress&,int&) at System.Net.Sockets.Socket.ReceiveFrom_nochecks_exc (System.Byte[] buf, Int32 offset, Int32 size, SocketFlags flags, System.Net.EndPoint& remote_end, Boolean throwOnError, System.Int32& error) [0x00000] in <filename unknown>:0 at System.Net.Sockets.Socket.ReceiveFrom_nochecks (System.Byte[] buf, Int32 offset, Int32 size, SocketFlags flags, System.Net.EndPoint& remote_end) [0x00000] in <filename unknown>:0 at System.Net.Sockets.Socket.ReceiveFrom (System.Byte[] buffer, System.Net.EndPoint& remoteEP) [0x00000] in <filename unknown>:0 at System.Net.Sockets.UdpClient.Receive (System.Net.IPEndPoint& remoteEP) [0x00000] in <filename unknown>:0 at UDPPacketIO.ReceivePacket (System.Byte[] buffer) [0x0003e] in C:\Users\Rushfell\Dropbox\Lusio\Lusio_Unity\Assets\Scripts\OSC\OSC.cs:244 at OSC.Read () [0x00014] in C:\Users\Rushfell\Dropbox\Lusio\Lusio_Unity\Assets\Scripts\OSC\OSC.cs:573 UnityEngine.Debug:Log(Object) OSC:Read() (at Assets/Scripts/OSC/OSC.cs:595)

I doesn't seem to necessarily do anything bad(?), as in preventing me from using OSC, but I felt I should report it. Using Unity 2018.2.1f1, but also had it happening in Unity 2017.4 before I upgraded the project.

skullthug avatar Aug 07 '18 07:08 skullthug

Ok, I figured out what the problem is. It is because of the UDP receive that is blocking the thread. I do not have enough experience to fix this.

thomasfredericks avatar Aug 27 '18 19:08 thomasfredericks

Basically I do not know how to break byte[] incoming = Receiver.Receive( ref iep ); before closing the Read() thread.

thomasfredericks avatar Aug 27 '18 19:08 thomasfredericks

I had the same problem (thread hang on the line byte[] incoming = Receiver.Receive( ref iep );

I recived the incoming osc data with a ocs monitor, but not in Unity. After turning off the firewall completly I got the incoming data. So I turned on firewall again, looked for advanced rules of the firewall (incoming rules) and there the Unity Version xxx entry. In my case, incoming connections weren't allowed for some reason for this version.

Maybe this helps someone. I searched hours for a solution and tested even other plugins.

noemis84 avatar Nov 11 '19 13:11 noemis84