Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jetty-users] EofException when client's socket abruptly disconnects/terminates...

Hello,

We have recently upgraded from Jetty 6.1.21 to Jetty 7.6.3.v20120416 and all has been well! That being said, I have encountered an issue and would appreciate any pointers/suggestions. I need to reliably detect abrupt client socket disconnects/terminations in our Servlet. Under Jetty 6.1.21, if a client abruptly disconnects/terminates whilst doing a POST, we would reliably get a org.mortbay.jetty.EofException. This would occur at:


at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:319)
at org.mortbay.jetty.HttpParser$Input.blockForContent(HttpParser.java:1136)
at org.mortbay.jetty.HttpParser$Input.read(HttpParser.java:1114)
at java.io.InputStream.read(Unknown Source)
...


Now believe it or not, we actually are relying on this behavior as we use it in our checkpoint/restart functionality for our EDIINT AS2 server functionality. This exception is no longer thrown in Jetty 7.6.3 and after looking at the Jetty source I am not quite sure how to detect this abrupt disconnection. I was wondering if there was a way to leverage the earlyEOF() method of the HttpParser.EventHandler class which appears to be called in the HttpParser.parseNext() method. However earlyEOF is a NOOP and the org.eclipse.jetty.server.AbstractHttpConnection.RequestHandler class which extends EventHandler does not override the earlyEOF() method. Is there a recommended approach for achieving this? Any suggestions would be appreciated. Thanks!


Jeff 

Back to the top