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
Comments (7)
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
- Required SpriteMask class (ID 331) is stripped when "Strip Engine Code" is enabled
- “Maximized serialized file backup not found” error is thrown when minimizing a window in a newly opened project
- Build stack trace contains invalid lines when building with IL2CPP using scripts with delegates containing generic types in the signature
- Entities Systems window has a “Show Full Player Loop” dropdown which does nothing when clicked after enabling “Show Full Player Loop”
- Entities Hierarchy Search “Show/Hide” button’s Lens Icon is blurry when the Editor is on an external monitor
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?