FireClosed() is called

Feb 28, 2012 at 2:44 AM

For some reasons that my websocket_closed event is called.  Is there a way to debug why the FireClosed is called?

Here is the call stack:



WebSocket4Net.dll!WebSocket4Net.WebSocket.ClientClosed(object sender, SystemEventArgs e)


 WebSocket4Net.dll!SuperSocket.ClientEngine.SslStreamTcpSession.OnDataRead(System.IAsyncResult result) + 0xd7 bytes 

My guess is the WebSocket received something that doesn't expect.  Any ideas?

Thank you.

Feb 28, 2012 at 2:45 AM

Could you also subscribe Error event?

websocket.Error += ...

Feb 28, 2012 at 3:08 AM
Edited Feb 28, 2012 at 4:24 AM

I did subscribe to the Error event, but the event handler didn't get called before the socket closed.  Also sometime the server will close the connection saying it received Channel Message: CloseWebSocketFrame and non-text data received from websocket. 

Does the dll send ping data or any non-text data behind the scene? 


May 9, 2012 at 2:11 AM

Yes, I'll add a property to disable it.

May 9, 2012 at 11:10 AM

A new property "EnableAutoSendPing" added!

Jun 11, 2012 at 1:04 PM


Is this feature really released in 0.6? I could not find it.

I am supposed to perform something similar like:

WebSocket websocket = new WebSocket("ws://localhost:2012/");
websocket.EnableAutoSendPing = false;

or do you do this in an other way?

Jun 11, 2012 at 1:06 PM

No, has not release this feature yet. It is in the source code, I'll create a release on these days!

Jun 11, 2012 at 1:23 PM

Thanks, found it from source code!

Jun 12, 2012 at 1:58 AM

A new release has been created: