Releasing the client port after the client has disconnected from the broker

Bug #1499683 reported by Kewal
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
mosquitto (Ubuntu)
Expired
Undecided
Unassigned

Bug Description

I am using an apollo broker and libmosquitto C client library to connect to the broker.After connecting and successfully publishing the message to the broker, i disconnect the client from the broker but the port that the client uses to connect to the broker is still not freed. Is there any way to manually free that port?

Revision history for this message
Gianfranco Costamagna (costamagnagianfranco) wrote :

did you try to see if the process was still alive? AFAIK ports are freed when the main pid exits

Changed in mosquitto (Ubuntu):
status: New → Incomplete
Revision history for this message
Roger Light (roger.light) wrote :

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.

Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for mosquitto (Ubuntu) because there has been no activity for 60 days.]

Changed in mosquitto (Ubuntu):
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.