Skip to content

WebSocketConnect in reconnect case #84

@VarnavaA

Description

@VarnavaA

Hi @endel
Thank you for your great work
I have tryed to resolve issue with reconnect socket that was close before
In jslib there is method WebSocketConnect
and in this method we have condition
if (instance.ws !== null) {...}
but if we called close socket before, we deleted instance.ws

instance.ws.onclose = function (ev) {
     if (webSocketState.onClose)
         Module.dynCall_vii(webSocketState.onClose, instanceId, ev.code);
     delete instance.ws;
};

then I try to connect web socket again and instance.ws !== null will be always true
in this case "instance.ws" will be 'undefined', so the better condition will be '!=' not '!=='
Does it make sense?
Thank you

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions