Hello
i am not able connect MQTT server in iOS 13.5.1
it works perfectly in android i am just facing issue to connect server on iOS only. can you please guide me where i am doing wrong.
Thanks!!
Environment
Operating system: macOS Catalina Version 10.15.5 (19F101)
Software version: Apple 6s(iOS 13.5.1)
Package Manager: Cocoapods -> pod 'MQTTClient'
MQTTClient version: MQTTClient (0.15.3)
MQTT Broker used: only used MQTTClient
MQTT code for connect to server
var transport = MQTTCFSocketTransport()
var mqttSession = MQTTSession()!
var completion: (()->())?
let MQTT_HOST = "tcp://domain.name.com"
let MQTT_PORT: UInt32 = 1883
Short description
Hello i am not able connect MQTT server in iOS 13.5.1 it works perfectly in android i am just facing issue to connect server on iOS only. can you please guide me where i am doing wrong. Thanks!!
Environment
MQTT code for connect to server
Link to logs
2020-07-16 17:54:52.468453+0530 MQTTDemo[31767:5988867] [MQTTSession] init 2020-07-16 17:54:52.470586+0530 MQTTDemo[31767:5988867] [MQTTSession] connecting 2020-07-16 17:54:52.470879+0530 MQTTDemo[31767:5988867] [MQTTCoreDataPersistence] deleteAllFlowsForClientId Comnect002 2020-07-16 17:54:52.471685+0530 MQTTDemo[31767:5988867] [MQTTPersistence] Persistent store: /Users/apple/Library/Developer/CoreSimulator/Devices/D3A73325-7A97-4D46-862D-8F8BADAC16FA/data/Containers/Data/Application/F88FF169-CC88-4F57-A02B-50318222ABC0/Documents/MQTTClient 2020-07-16 17:54:52.503670+0530 MQTTDemo[31767:5988867] [MQTTCFSocketTransport] open 2020-07-16 17:54:52.506582+0530 MQTTDemo[31767:5988867] [MQTTCFSocketEncoder] setState 0/0 2020-07-16 17:54:52.508730+0530 MQTTDemo[31767:5988867] [MQTTCFSocketEncoder] NSStreamEventErrorOccurred 2020-07-16 17:54:52.508953+0530 MQTTDemo[31767:5988867] [MQTTCFSocketEncoder] setState 0/2 2020-07-16 17:54:52.509518+0530 MQTTDemo[31767:5988867] [MQTTSession] mqttTransport didFailWithError Error Domain=kCFErrorDomainCFNetwork Code=1 "(null)" UserInfo={_kCFStreamErrorCodeKey=1, _kCFStreamErrorDomainKey=12} Optional(Error Domain=kCFErrorDomainCFNetwork Code=1 "(null)" UserInfo={_kCFStreamErrorCodeKey=1, _kCFStreamErrorDomainKey=12}) error==> Optional(Error Domain=kCFErrorDomainCFNetwork Code=1 "(null)" UserInfo={_kCFStreamErrorCodeKey=1, _kCFStreamErrorDomainKey=12}) error==> The operation couldn’t be completed. (kCFErrorDomainCFNetwork error 1.) 2020-07-16 17:55:29.079340+0530 MQTTDemo[31767:5988867] [MQTTSession] closeInternal 2020-07-16 17:55:29.080570+0530 MQTTDemo[31767:5988867] [MQTTCFSocketTransport] close not connected
Expected behaviour
it should be connect
Actual behaviour
not connect and throwing error
Other information
Please let me know if you need any more information.