Skip to content

Problem connecting to custom namespace #1033

Closed
@OneSman7

Description

@OneSman7

I think we have a racing condition here. Sometimes request to connect to custom namespace (40/nsp) is not sent.
We debugged it to the method flushProbeWait() in SocketEngine.
It is called on web socket connect success in doFastUpgrade() and on web socket connect failure in websocketDidDisconnect(error: Error?) (in case we are polling which is always true on start). Inside this method we have this code:

if postWait.count != 0 {
            flushWaitingForPostToWebSocket()
        }

Method flushWaitingForPostToWebSocket() causes packets to be sent by web socket. And it fails if web socket failed to connect. In our case we lose request to connect to custom namespace and do not get connected at all.
I think it will be better to move this "if" from flushProbeWait() directly to doFastUpgrade(), so it will be called only on web socket connect success.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions