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

Connection issue #584

Open
sreekandukuri opened this issue Mar 21, 2024 · 0 comments
Open

Connection issue #584

sreekandukuri opened this issue Mar 21, 2024 · 0 comments

Comments

@sreekandukuri
Copy link

We are encountering the following issue when attempting to connect with the code below.

CocoaMQTT(debug): socket disconnected
mqttDidDisconnect: Optional(Error Domain=NSPOSIXErrorDomain Code=61 "Connection refused" UserInfo={NSLocalizedDescription=Connection refused, NSLocalizedFailureReason=Error in connect() function})

    let clientID = "XXX"
    mqtt = CocoaMQTT(clientID: clientID, host: "XXX", port: 1883)
    mqtt.username = "XXX"
    mqtt.password = "XXX"
    //mqtt.willMessage = CocoaMQTTWill(topic: "/will", message: "dieout")
    mqtt.keepAlive = 60
    mqtt.delegate = self
    mqtt.logLevel = .debug
    mqtt.autoReconnect = false
    mqtt.connect()
    
    Thanks in advance
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

1 participant