Calling mosquitto_disconnect() doesn't immediately disconnect the client, it sends the DISCONNECT packet and once that packet is sent, it then closes the socket. You can wait until the on_disconnect() callback is triggered to make sure this has happened. Alternatively, calling mosquitto_destroy() will close the socket.
It is worth noting that sockets remain in the CLOSE_WAIT state for a reasonable amount of time, so the socket may not appear to have been released in e.g. netstat. -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1499683 Title: Releasing the client port after the client has disconnected from the broker To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/mosquitto/+bug/1499683/+subscriptions -- ubuntu-bugs mailing list [email protected] https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
