Export to GitHub

socketio-java - issue #1

Jetty and Firefox issue - Disconnect caused by timeout


Posted on Nov 30, 2010 by Swift Panda

I'm using socketio-java-20101106 and having a issue with Firefox timing out.

The issue is 100% reproducible with the include ChatServer. I'm using Jetty 7.1.6, Win7, Java6 1.6.0_16, Firefox 3.6.12.

1) I start the ChatServer and point Firefox at http://localhost:8080/chat.html 2) Type a single message and press Send. 3) Wait. 4) In the Java console I see the expected series of pings, up until ping 14, at which point I see

IDLE SCEP@13170424 [d=false,io=1,w=true,rb=false,wb=false] Session[iNgSlINkBB4NZl0yHevy]: sendPing 14 Session[iNgSlINkBB4NZl0yHevy]: sendMessage: [PING]: 14 Session[iNgSlINkBB4NZl0yHevy]: onTimeout Session[iNgSlINkBB4NZl0yHevy]: onDisconnect: TIMEOUT

After this the client is disconnected. Same thing happens with Opera 11.00 build 1111. Chrome seems to work well but that's using a different transport so not that surprising.

I did notice the "IDLE SCEP" line preceded the problem.

Some Googling turned up these (maybe similar ??) issues. http://jira.codehaus.org/browse/JETTY-1270 http://code.google.com/p/wave-protocol/issues/detail?id=110

Anyone else seeing this or have any ideas on a workaround? If interested the full logs are posted here. http://paste.pocoo.org/show/297820/

Comment #1

Posted on Nov 30, 2010 by Grumpy Rhino

Calling setMaxIdleTime(0) on the SelectChannelConnector instance solves this problem. There is no way via the Servlet 2.5 API to do this on a per-connection basis. The Jetty WebSocket implementation takes advantage of the Jetty internals to set the max idle time. I'll modify the examples to set the max idle time and add a comment explaining why it's needed.

Comment #2

Posted on Dec 2, 2010 by Swift Panda

Thanks Tad, that fixes the problem for me.

Comment #3

Posted on Dec 4, 2010 by Grumpy Rhino

A more complete solution has been implemented in the latest release (20101204). With this release it is not necessary to all setMaxIdleTime(0) on the SelectChannelConnector instance.

Status: Fixed

Labels:
Type-Defect Priority-Medium