|
From: Julio V. <jul...@ju...> - 2008-11-24 17:49:02
|
Hello, I'm trying to query if underlying socket in ChannelEndPoint is still connected, so then I can commit a transaction. So I'm issuing the following Jetty-specific code inside my app: ((ChannelEndPoint) HttpConnection.getCurrentConnection().getEndPoint()).getChannel().read(ByteBuffer.allocate(1)) If the above line returns -1, I'm assuming socket disconnected, and the transaction is rolled back. For else(gte 0), it still connected and transaction in course is commited. Can I assume this as correct approach, or there's a better way of doing this? Rgrds, JV -- julioviegas.com |