aciidgh / SwiftMQTT

MQTT Client in pure swift ❤️
MIT License
270 stars 71 forks source link

Socket Error & Disconnect #11

Open YnotZer0 opened 7 years ago

YnotZer0 commented 7 years ago

I'm using iOS10, XCode 8 and Swift 3 and the SwiftMQTTExample project code and it upgrades the following code from: func mqttSession(session: MQTTSession, received message: Data, in topic: String) { let string = String(data: message, encoding: .utf8)! appendStringToTextView("data received on topic (topic) message (string)") }

to: func mqttDidReceive(message data: Data, in topic: String, from session: MQTTSession) { let string = String(data: message, encoding: .utf8)! appendStringToTextView("data received on topic (topic) message (string)") }

I receive the MQTT message perfectly fine, but, I then get a Socket Error and a Disconnect every time. Is there something that can be tested/fixed?

bhargavg commented 7 years ago

@YnotZer0 Were you able to reproduce the issue?