att.startLatch(1);\r
socket.getPoller().add(socket,SelectionKey.OP_WRITE);\r
att.getLatch().await(writeTimeout,TimeUnit.MILLISECONDS);\r
+ att.resetLatch();\r
}catch (InterruptedException ignore) {\r
}\r
if ( att.getLatch() == null ) keycount = 1;\r
att.startLatch(1);\r
socket.getPoller().add(socket,SelectionKey.OP_READ);\r
att.getLatch().await(readTimeout,TimeUnit.MILLISECONDS);\r
+ att.resetLatch();\r
}catch (InterruptedException ignore) {\r
}\r
if ( att.getLatch() == null ) keycount = 1;\r
}
}
}
-
}
processSocket(channel, SocketStatus.DISCONNECT);
} else if ( attachment.getLatch() != null ) {
attachment.getLatch().countDown();
- attachment.resetLatch();
} else {
+ //this sucker here dead locks with the count down latch
+ //since this call is blocking if no threads are available.
+ //TODO: FIXME BIG TIME
boolean close = (!processSocket(channel));
if ( close ) {
channel.close();