Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SRHubProxyInterface.invoke - completionHandler called twice #293

Open
BRH-Enrian opened this issue Aug 16, 2017 · 3 comments
Open

SRHubProxyInterface.invoke - completionHandler called twice #293

BRH-Enrian opened this issue Aug 16, 2017 · 3 comments

Comments

@BRH-Enrian
Copy link

BRH-Enrian commented Aug 16, 2017

I've noticed that my completion handlers for proxy invoke calls get called twice. Here's a snippet from my code:

var counter = 0
proxy.invoke("groupdisconnect", withArgs: [roomId]) { [weak self] response, error in
    guard let wself = self else { return }
    counter += 1
    wself.logger.log("leaveRoom - \(counter) res: \(response.debugDescription) err: \(error.debugDescription)")
    if counter == 2 {
        DispatchQueue.main.async {
            wself.logger.log("disconnecting from hub")
            wself.proxy = nil
            wself.hub?.disconnect()
            wself.hub = nil
        }
    }
}

Here's the log lines from above:

2017-08-17 01:16:58.314 Nedbank[11425:126321] 23:16:58.314 WebSocketClient: leaveRoom - 1 res: nil err: nil
2017-08-17 01:16:58.858 Nedbank[11425:126321] 23:16:58.858 WebSocketClient: leaveRoom - 2 res: nil err: nil

So, is this normal? And why is res always nil?

@obzone
Copy link

obzone commented Dec 5, 2017

the same question with me

@obzone
Copy link

obzone commented Dec 5, 2017

try to comment out lines from 78 to 80 in "SRWEBSocketTransport" file will fix it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@obzone @BRH-Enrian and others