FireClosed() is called

Feb 28, 2012 at 3: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.FireClosed()

WebSocket4Net.dll!WebSocket4Net.WebSocket.OnClosed()

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

WebSocket4Net.dll!SuperSocket.ClientEnginee.ClientSessionOnClosed()

 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.

Coordinator
Feb 28, 2012 at 3:45 AM

Could you also subscribe Error event?

websocket.Error += ...

Feb 28, 2012 at 4:08 AM
Edited Feb 28, 2012 at 5: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? 

Thanks.

Coordinator
May 9, 2012 at 3:11 AM

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

Coordinator
May 9, 2012 at 12:10 PM

A new property "EnableAutoSendPing" added!

Jun 11, 2012 at 2: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;
websocket.Open();

or do you do this in an other way?

Coordinator
Jun 11, 2012 at 2: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 2:23 PM

Thanks, found it from source code!

Coordinator
Jun 12, 2012 at 2:58 AM

A new release has been created:

http://websocket4net.codeplex.com/releases/view/89345