Skip to content

Initial Connect message can not be sent due to WebsocketStompKit.socket not being connected #9

@mixdux

Description

@mixdux

Hello guys, it's me again! After some recent debugging on the server side, we indirectly found out a slight omission that occurs during initial web socket connection process:

  1. After receiving 101 from server, websocketDidConnect:(JFRWebSocket*) socket method gets called
  2. sendFrameWithCommand:(NSString *)command... is then called and is supposed to send kCommandConnect message to server

The problem occurs within send method, more precisely:

if (![self.socket isConnected]) {
    return;
}

In small number of cases it happens that socket is indeed not connected and initial connection won't be made. Moreover, neither websocketDidDisconnect:(NSError *)error delegate method nor client's connectWithHeaders: method('s block) do not get called back. I had no definitive way of knowing whether connection is slow and super laggy or initial connection hasn't been made; so I added a call to websocketDidDisconnect:(NSError *)error with custom error which I further on handle by myself.

As I mentioned earlier, this happens in small number of cases but should be addressed since workarounds sometimes may omit a key library callback or function they are supposed to call. Cheers!

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