Search Issue Tracker
By Design
Votes
0
Found in
5.3.4f1
Issue ID
780580
Regression
Yes
[Debug] Running project with attached debugger causes Socket exception if Socket is in another thread
Steps to reproduce:
1. Open attached project
2. Open scene "1"
3. Run it and notice "Thread Start!" message in console
4. Open IPC.cs script using Visual Studio (or MonoDevelop) and attached debugger
5. Run scene again
6. In console, notice Socket Exception: System.Net.Sockets.SocketException: A blocking operation was interrupted by a call to WSACancelBlockingCall.
Note: Doesn't happen if socket is running from the main thread (Update)
Workaround: Don't attach debugger
Not reproducible: 5.2.4f1
Reproduced with: 5.3.0f4, 5.3.4f1, 5.4.0b11
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Incorrect ScrollToItem behavior when called on a deattached ListView
- Zooming in/out in Scene View window on the display the zoom takes place in does not work
- Changing Game View resolution when there are 2 Game View Windows on 2 different displays makes the view stretched
- Maximising Game view window on one display makes black bars appear on another display
- Creating a 3D Object when using 2 monitors and 2 Game View Windows on different monitors the created 3D Object only appears on one of them
sebrk_hiq
Sep 26, 2017 19:48
God I'm sick of these "By design" answers without any further explanation. I'm running the listener in main thread and still get this error.
tabulatouch
Jan 17, 2017 22:06
I found i could only handle server connections creating and starting a TcpListener first, then using this in the Update:
if (listener.Pending()) {
var nativeClient = listener.AcceptTcpClient();
...
}
This way the server smoothly accepts and handles requests.
danielhouston
Nov 17, 2016 03:22
@TapioFragment I have tried your workaround using listener.BeginAcceptSocket() but when I call listener.EndAcceptSocket() I get the same WSACancelBlockingCall exception. Do you have that problem still or does it work for you?
tapiofragment
Oct 27, 2016 06:21
I found that blocking on AcceptTcpClient gets interrupted and the workaround for that is as easy as using BeginAcceptTcpClient and blocking instead on AsyncWaitHandle.WaitOne.
Jung-DongHun
Oct 20, 2016 06:09
No way...
Protectator
Aug 23, 2016 11:56
How is "Do not use the debugger anymore" a workaround ? Ain't there an other realistic option ?
Also, some details of why is this ok by design would be helpful.
B16B0SS
Jul 05, 2016 12:33
This workaround isn't very realistic. How can I debug my server with this?