Socket messages appear to be one behind

173 views Asked by At

I apologize for the vague question title, but I can't think of a better way to describe the issue.

I'm connecting to a socket.io server (netty) using redannick's FlashSocket.IO library

Everything (connection, handshake, protocol upgrade) seems to work correctly, but when it comes time to start sending/receiving messages, I'm noticing an odd trend: all of the responses to my messages are behind by 1.

The most basic example I can give is that I have to send two PINGs before I receive a single PONG, and the PONG that I do receive is actually a response to the first PING.

A more detailed example: I send a message with a room ID. This message is supposed to receive a response in the form of "room-ID activated." I will not receive that response until after another message is sent from the server.

I can force the server to send another message by following the room ID message with a PING. This triggers a PONG sent from the server, but the only message I receive on the client side is the "room-ID activated" message.

I have a feeling the problem lies somewhere within the FlashSocket.IO library, but I'm not sure exactly where to look. I know for a fact that the server is sending all the messages it's supposed to send because I have a test app written in JavaScript using socket.io's client and it works as expected.

0

There are 0 answers