This commit is contained in:
Greg Wilkins 2017-10-20 09:41:47 +11:00
parent 9947a497a6
commit 06e00355a2
2 changed files with 4 additions and 3 deletions

View File

@ -418,10 +418,10 @@ public class ManagedSelector extends AbstractLifeCycle implements Runnable, Dump
private EndPoint createEndPoint(SocketChannel channel, SelectionKey selectionKey) throws IOException
{
EndPoint endPoint = _selectorManager.newEndPoint(channel, this, selectionKey);
_selectorManager.endPointOpened(endPoint);
Connection connection = _selectorManager.newConnection(channel, endPoint, selectionKey.attachment());
endPoint.setConnection(connection);
selectionKey.attach(endPoint);
_selectorManager.endPointOpened(endPoint);
_selectorManager.connectionOpened(connection);
if (LOG.isDebugEnabled())
LOG.debug("Created {}", endPoint);

View File

@ -195,11 +195,12 @@ public class LocalConnector extends AbstractConnector
if (LOG.isDebugEnabled())
LOG.debug("accepting {}", acceptorID);
LocalEndPoint endPoint = _connects.take();
endPoint.onOpen();
onEndPointOpened(endPoint);
Connection connection = getDefaultConnectionFactory().newConnection(this, endPoint);
endPoint.setConnection(connection);
endPoint.onOpen();
onEndPointOpened(endPoint);
connection.onOpen();
}