Add connection before init, so init happens before polling of events

This commit is contained in:
Robinson 2023-09-25 13:53:37 +02:00
parent 8bbaa6df18
commit be78d498dc
No known key found for this signature in database
GPG Key ID: 8E7DB78588BD6F5C
2 changed files with 3 additions and 3 deletions

View File

@ -825,9 +825,10 @@ open class Client<CONNECTION : Connection>(config: ClientConfiguration = ClientC
listenerManager.notifyInit(newConnection)
}
connection0 = newConnection
// this enables the connection to start polling for messages
addConnection(newConnection)
connection0 = newConnection
// if we shutdown/close before the poller starts, we don't want to block forever
pollerClosedLatch = CountDownLatch(1)
networkEventPoller.submit(

View File

@ -146,7 +146,6 @@ internal class ServerHandshake<CONNECTION : Connection>(
listenerManager.notifyInit(newConnection)
}
// this enables the connection to start polling for messages
server.addConnection(newConnection)