> -----Original Message----- > From: Konstantin Preißer [mailto:kpreis...@apache.org] > Sent: Thursday, October 17, 2013 1:23 AM > To: 'Tomcat Developers List' > Subject: Tomcat closes Websocket connection when using a SSL HTTP APR > connector (was: RE: Tagging 7.0.46) > > > -----Original Message----- > > From: Konstantin Preißer [mailto:kpreis...@apache.org] > > Sent: Wednesday, October 16, 2013 3:33 PM > > > I also need to do more testing because the error is not very reproducible > on > > my current machine (but I have another one where it was more > > reproducible) to make sure what error exactly happens and when. > > Hi, > > I am now on a machine (Intel Core i7-3770, Win8 x64) where I can reproduce > the error very easily (after a few seconds of drawing at the drawboard). > > In summary: When running current Tomcat trunk on Windows 8 x64 with Java > 1.7.0_45 x64 and TC-Native 1.1.29, and using a SSL HTTP APR connector, then > Tomcat will close the Websocket connection after a few seconds of drawing > to the Drawboard Websocket example. This does not happen with a non-SSL > APR connector. > > What I did was: > 1) Checkout trunk (r1532781). Then update the path > "webapps/examples/WEB-INF/classes/websocket" to r1532286 because > after this revision I made a change to the Room implementation which makes > the error harder to reproduce. > 2) Build the working copy, then copy the current v1.1.29 "tcnative-1.dll" into > the bin directory. > 3) Configure a SSL HTTP APR connector in server.xml: > > <Connector > protocol="HTTP/1.1" > port="8443" maxThreads="200" > scheme="https" secure="true" SSLEnabled="true" > connectionTimeout="20000" > SSLCertificateFile="${catalina.base}\conf\ssl\mycert.crt" > SSLCertificateKeyFile="${catalina.base}\conf\ssl\mypem.pem" > SSLVerifyClient="optional" SSLProtocol="TLSv1" > /> > > 4) Run Tomcat; then open Firefox and visit > https://localhost:8443/examples/websocket/drawboard.xhtml > 5) Draw continuously on the drawboard (e.g. by doing fast circular > movements with the mouse) using the "Brush" setting. > 6) After a several seconds, Firefox will display "Websocket connection > closed" and you can't draw anymore. Tomcat doesn't log anything to the > console. > > When using my TCP forwarder tool between Firefox and Tomcat, I can see > that Tomcat aborts/resets the TCP connection (Winsock error: 10053 and > 10054) when this happens. > > When you try this with a non-SSL HTTP APR connector, everything works > fine: The Websocket connection will not be closed, regardless of how long > you are drawing.
Additional information: When I try this with r1532720, then when this close of the Websocket connection happens, Tomcat logs following exception: 17-Oct-2013 01:38:28.378 SEVERE [http-apr-8443-exec-1] websocket.drawboard.DrawboardEndpoint.onError onError: java.io.IOException: Unexpected error [20,014] reading data from the APR/native socket [245,310,416]. java.io.IOException: Unexpected error [20,014] reading data from the APR/native socket [245,310,416]. at org.apache.coyote.http11.upgrade.AprServletInputStream.doRead(AprServletInputStream.java:104) at org.apache.coyote.http11.upgrade.AbstractServletInputStream.read(AbstractServletInputStream.java:116) at org.apache.tomcat.websocket.server.WsFrameServer.onDataAvailable(WsFrameServer.java:46) at org.apache.tomcat.websocket.server.WsHttpUpgradeHandler$WsReadListener.onDataAvailable(WsHttpUpgradeHandler.java:192) at org.apache.coyote.http11.upgrade.AbstractServletInputStream.onDataAvailable(AbstractServletInputStream.java:169) at org.apache.coyote.http11.upgrade.AbstractProcessor.upgradeDispatch(AbstractProcessor.java:95) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:640) at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:282) at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2461) at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2450) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:744) However, since r1532721, when the closing of Websocket/TCP connection happens, no exception is logged. Regards, Konstantin Preißer --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org