Forum ActionScript 3.0 Please respond to this defect about "connection.disconnect"

Problems and discussions relating to ActionScript 3.0 here.

Please respond to this defect about "connection.disconnect"

Postby guixizheng » February 13th, 2017, 3:41 am

error: operation attempted on invalid socket

Postby jgames » February 12th, 2013, 3:39 pm
Can anyone tell me what this is and why I'm getting it? I have no idea why I get this error from an anonymous function.

Error: Error #2002: Operation attempted on invalid socket.
at flash.net::Socket/readUnsignedByte()
at Function/<anonymous>()
----------------------------------------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------
Re: error: operation attempted on invalid socket

Postby sevans » August 9th, 2013, 11:45 pm
This post is pretty old, but FWIW, I believe this is being caused by disconnecting from the room while in a callback function. My guess at whats happening is that another message is sitting in the queue when you call disconnect. Player.IO tries to process the message but the socket is no longer valid.

Best of luck!

Update: I was able to duplicate the issue and remedied it by delaying the disconnect call until the next enter frame. Kind of a hack, but its a decent work around until an API fix is implemented.
----------------------------------------------------------------------------------------------------
guixizheng
 
Posts: 5
Joined: July 1st, 2016, 4:49 am

Return to ActionScript 3.0