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
- Rigidbody2D.Slide API does not have the needed configuration when creating a 2D Top-Down character controller
- Opening reference for "Playables"component redirects to a missing page
- Sprite Renderer image is changed when switching Mask Interaction and changing Sprite to a shared Sprite
- An unsigned integer is not compared with an integer correctly in player when using IL2CPP backend
- Graphical artifacts are being rendered in Scenes that are loaded during run-time when GPU Resident Drawer is turned on
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?