WebSocket4Net icon indicating copy to clipboard operation
WebSocket4Net copied to clipboard

Re-open a closed websocket, get an exception of "An unhandled exception of type

Open jliu1970 opened this issue 7 years ago • 4 comments

'System.Exception' occurred in SuperSocket.ClientEngine.dll Additional information: The socket is connected, you needn't connect again! occurred

Hi Kerry,

In an error handling case, our design of the handler of websocket Closed event will try to re-establish the connection. The connection code looks like :

if(!(websocket.state == WebSocketState.Open)) { websocket.open(); }

In one of the test case, we shut down the websocket server at the server side, it is found that the code does not work all the time, the above exception was thrown in some instances.

When the exception was thrown, we noticed that the websocket.state was closed, as expected.

Any reason why the socket is still connected, when the websocket is closed?

Thanks Jimmy

jliu1970 avatar Jul 17 '17 20:07 jliu1970

Could you try the latest version: 0.15?

kerryjiang avatar Sep 05 '17 04:09 kerryjiang

Kerry,

Sorry that I missed your previous communication. I will pick up the latest version.

Thanks Jimmy

On Mon, Sep 4, 2017 at 11:37 PM, Kerry Jiang [email protected] wrote:

Could you try the latest version: 0.15?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/kerryjiang/WebSocket4Net/issues/99#issuecomment-327069248, or mute the thread https://github.com/notifications/unsubscribe-auth/Aac_y8j-gVq2OPZ0VWVy8dUqUKSoEhXuks5sfNAmgaJpZM4OahhW .

jliu1970 avatar Sep 05 '17 13:09 jliu1970

Same issue here. What can be the cause? @kerryjiang

kristijan97 avatar Oct 16 '17 07:10 kristijan97

Same issue for me too also with the latest version. Any news here?

nowkin avatar Dec 01 '17 13:12 nowkin