Fix reentrance bug when writing in connectionOpened.

This commit is contained in:
Matt Corallo 2013-11-28 01:19:16 -05:00 committed by Mike Hearn
parent ba543a3b10
commit c10ebd260c

View file

@ -56,8 +56,8 @@ public class NioClientManager extends AbstractExecutionThreadService implements
try {
if (sc.finishConnect()) {
log.info("Successfully connected to {}", sc.socket().getRemoteSocketAddress());
handler.parser.connectionOpened();
key.interestOps(SelectionKey.OP_READ).attach(handler);
handler.parser.connectionOpened();
} else {
log.error("Failed to connect to {}", sc.socket().getRemoteSocketAddress());
handler.closeConnection(); // Failed to connect for some reason