Hi
I am newer in MQTT and used your library and want to make connection with following server URL:Ws://trialadm.satalarm.com/mqtt
I am using below code but getting error
Response Error :
mqttDidDisconnectOptional(Error Domain=NSPOSIXErrorDomain Code=57 "Socket is not connected" UserInfo={NSErrorFailingURLStringKey=http://trialadm.satalarm.com:8000/mqtt, NSErrorFailingURLKey=http://trialadm.satalarm.com:8000/mqtt})
There are 2 things first I am not able to connect and second thing the url which is showing in response is having http url as it should Ws url.
Please let me know whats wrong with this.
Hi I am newer in MQTT and used your library and want to make connection with following server URL:Ws://trialadm.satalarm.com/mqtt I am using below code but getting error Response Error : mqttDidDisconnectOptional(Error Domain=NSPOSIXErrorDomain Code=57 "Socket is not connected" UserInfo={NSErrorFailingURLStringKey=http://trialadm.satalarm.com:8000/mqtt, NSErrorFailingURLKey=http://trialadm.satalarm.com:8000/mqtt})
Code : let clientID = "CocoaMQTT-" + String(ProcessInfo().processIdentifier) let websocket = CocoaMQTTWebSocket(uri: "/mqtt") let mqtt = CocoaMQTT(clientID: clientID, host: "trialadm.satalarm.com", port:8000, socket: websocket) mqtt.username = "nit" mqtt.password = "VR4xZCwPoBVAoxaHCI1R" mqtt.keepAlive = 60 mqtt.delegate = self // mqtt.allowUntrustCACertificate = true //mqtt.enableSSL = false mqtt.willMessage = CocoaMQTTMessage(topic: "testtopic/1212", string: "Testing rg") mqtt.willMessage?.retained = true let connect = mqtt.connect()
There are 2 things first I am not able to connect and second thing the url which is showing in response is having http url as it should Ws url. Please let me know whats wrong with this.