simplified connect redispatch logic

This commit is contained in:
Robinson 2023-08-07 19:56:14 -06:00
parent 59bc934dc1
commit 8aa919b28a
No known key found for this signature in database
GPG Key ID: 8E7DB78588BD6F5C
1 changed files with 1 additions and 2 deletions

View File

@ -465,8 +465,7 @@ open class Client<CONNECTION : Connection>(
// on the client, we must GUARANTEE that the disconnect/close completes before NEW connect begins.
// we will know this if we are running inside an INTERNAL dispatch that is NOT the connect dispatcher!
val currentDispatcher = EventDispatcher.getCurrentEvent()
if (currentDispatcher != null && currentDispatcher != EventDispatcher.CONNECT) {
if (EventDispatcher.getCurrentEvent() != EventDispatcher.CONNECT) {
EventDispatcher.CONNECT.launch {
connect(
remoteAddress = remoteAddress,