1
Vote

SuperWebSocket client: handshake and message arrive in same packet

description

Kerry, thanks for the great work on the only freely available WebSocket client in .NET so far! I found an issue in the client where the browser may send a message in the same packet as its handshake response. This is a problem that does not occur on the server, where of course only a handshake is received. But the server can receive the client handshake, calculate its response, AND send its first message all in one TCP packet. Perhaps with your re-write this issue has been fixed? Thanks!

comments

kerryjiang wrote Dec 11, 2011 at 4:29 AM

I don't understand the issue you reported. The TCP is stream base protocol, and doesn't support transferring level package.

sebastiang wrote Dec 12, 2011 at 4:18 AM

You're right, it's not necessarily one packet, but one buffer's worth of data received in the async callback. the state machine in the client assumes it is either parsing a handshake, or parsing regular messages. In fact, one buffer can contain both the handshake (response) and one or more messages.

kerryjiang wrote Dec 12, 2011 at 4:54 AM

I know your issue now, I'll check it today, and then give you a feedback ASAP.

kerryjiang wrote Jan 5, 2012 at 2:02 PM

Hi, the latest code should have fixed this issue now.