sockjs / sockjs-erlang

WebSocket emulation - Erlang server
http://sockjs.org
Other
266 stars 120 forks source link

Experimental buffer flushing after session was closed #38

Open mrjoes opened 12 years ago

mrjoes commented 12 years ago

Few notes:

  1. Not sure if it should check response_pid from the state.
  2. I tried it locally with different transports - appears to be working
hyperthunk commented 11 years ago

Hi @mrjoes - can you explain the rationale behind this patch for me please? I'm happy to do the QA and merge, but I need to properly understand the intent first.

mrjoes commented 11 years ago

Sure. For polling transports, when server closes connection, there might be something left in the outgoing queue. However, when client comes back to get more data, server sees that session was closed and will deny the request without flushing the queue.

So, it is not working according to websocket spec.

hyperthunk commented 11 years ago

Right, that makes sense. Let me read through the spec and spend a but of time looking over the code. Hopefully I'll be able to answer (1) and we can get it merged.