On 17/10/2013 00:44, Konstantin Preißer wrote: <snip/>
> 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. I think this might be a bug in the tc-native library. I added some debug logging to AprServletInputStream and recorded the value of result in the doRead() method for every read. There is a long series of these results: Read result [1] Read result [48] Read result [-120002] which looks fairly normal (I need to look into why we see a single byte and then 48 bytes rather than 49 bytes). When it goes wrong, the sequence is: Read result [1] Read result [48] Read result [-20014] 18-Oct-2013 12:23:25.298 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 [364,180,784]. which suggests to me that something goes wrong at a lower level than the Java code. I've checked the state of the byte array when the error occurs and it is an empty 8k array with offset of 0. The other possibility is that I am not using the API correctly. There was an issue with SSL writes that meant that I needed to use a dedicated ByteBuffer for all SSL writes. It might be the case that I need to do something similar for reads. Hopefully Mladen can comment on that. Mark --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org