biddyweb / socketio-java

Automatically exported from code.google.com/p/socketio-java
0 stars 0 forks source link

Jetty and Firefox issue - Disconnect caused by timeout #1

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
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/

Original issue reported on code.google.com by cgri...@gmail.com on 30 Nov 2010 at 1:10

GoogleCodeExporter commented 9 years ago
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.

Original comment by Tad.Glines@gmail.com on 30 Nov 2010 at 11:59

GoogleCodeExporter commented 9 years ago
Thanks Tad, that fixes the problem for me.

Original comment by cgri...@gmail.com on 2 Dec 2010 at 1:32

GoogleCodeExporter commented 9 years ago
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.

Original comment by Tad.Glines@gmail.com on 4 Dec 2010 at 9:33