On Sat, Nov 17, 2012 at 7:37 AM, Ngoc Dao <
ngocda...@gmail.com> wrote:
>> Ok, please try to implement other services also and attempt to
>> pass all the sockjs protocol tests. This is important for interoperability,
>
> I have this problem when trying to pass
> HandlingClose.test_abort_xhr_streaming and
> HandlingClose.test_abort_xhr_polling:
>
http://sockjs.github.com/sockjs-protocol/sockjs-protocol-0.3.3.html#section-149
>
> The test client closes the first connection:
> r1.close()
>
> Then immediately establishes another connection:
> r3 = POST_async(url + '/xhr_streaming')
>
> And asserts that this new connection should not be "Another connection
> still open". But due to TCP nature, the server does not immediately
> know that the first connection has been closed!
Yes, but it will be closed half a millisecond later.
> I'm using Netty on Mac. Netty only know that the first connection has
> been closed when it tries to send the keep alive message to the first
> connection (after 25 seconds).
That's a bug in Netty, sorry. You should be able to react to network
connection being broken immediately. It's possible (with a bit of hackery)
in node, python, erlang, etc. It must be possible in netty.
> My question is: Are the two "abort" tests themselfves broken? Is there
> anything I can do to pass the tests?
Yes. Make Netty react to an event when underlying network connection
gets closed.
Use Wireshark / Tcpdump to see when actually the FIN packet was sent
by the protocol tests.
Marek