sockjs-protocol
sockjs-protocol copied to clipboard
Test suite: adding tests for discarding messages on #close in polling transport
There's a significant difference between behaviour of primitive transports such as polling and more advanced transport such as websockets in case of closing connection in user app (see http://pastie.org/pastes/3011573). So whereas websocket tranport do deliver all the messages, primitive transports buffer messages and if user call #close, buffer won't be ever send, hence these messages shall not be delivered.
This behaviour should be tested.
Also, we should test what happens when one sends a message if the session is in 'closed' state. The message should be discarded, but the 'send' shouldn't raise 404.
Good point.