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

Subscribe socket error at 2 message #42

Open
k4reash opened this issue May 14, 2019 · 4 comments
Open

Subscribe socket error at 2 message #42

k4reash opened this issue May 14, 2019 · 4 comments

Comments

@k4reash
Copy link

k4reash commented May 14, 2019

Hi,
I can't receive more than 1 message without disconnection (Socket error)

What is the correct way to suscribe to a topic?

This is my code:

https://pastebin.com/ad1D8P4w

@k4reash
Copy link
Author

k4reash commented May 20, 2019

Error in console: nw_socket_handle_socket_event [C1:1] Socket SO_ERROR [54: Connection reset by peer]

@k4reash k4reash changed the title Subscribe on SwiftMQTTExample Subscribe socket error SwiftMQTT May 20, 2019
@k4reash k4reash changed the title Subscribe socket error SwiftMQTT Subscribe socket error at 2 message May 20, 2019
@kervich
Copy link

kervich commented Jun 24, 2019

I suspect this is a duplicate of #39 - @alexkite03, what version of Xcode/Swift toolchain are using? One of the "effects" of #39 is that msgID is not read (or parsed right for that matter) from the subscribe ack and the socket hangs open waiting for the ack with expected msgId to be received, however server drops the socket after a while, since the ack has been sent and delivered, but never acted upon.

@jamesbebbington
Copy link

Hey @kervich, I'm seeing the same issue on Xcode 11 Beta (11M336w) on macOS 10.15 Beta (19A471t).

@cdf1982
Copy link

cdf1982 commented Jul 26, 2021

Hello, I'm also experiencing the same issue ("[connection] nw_socket_handle_socket_event [C1:1] Socket SO_ERROR [54: Connection reset by peer]") where the connection is closed after successfully receiving the first message; if I don't send messages, pings are regularly received without never closing the connection. Anyone found a workaround?

EDIT: Someone did!, the commit 0b3256f works like a charm.

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

4 participants