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
socket leakage #304
Labels
Milestone
Comments
Pull request opened for this #307 |
thlassche
added a commit
to thlassche/mosquitto
that referenced
this issue
Nov 7, 2016
Signed-off-by: Teun Lassche <[email protected]>
ralight
pushed a commit
that referenced
this issue
Dec 4, 2016
Signed-off-by: Teun Lassche <[email protected]>
ralight
added a commit
that referenced
this issue
Dec 4, 2016
Thanks both, this is now fixed in the fixes branch. |
Closed
ralight
pushed a commit
that referenced
this issue
Feb 20, 2017
Signed-off-by: Teun Lassche <[email protected]>
ralight
added a commit
that referenced
this issue
Feb 20, 2017
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
when reconnect is needed, previous socket is not closed.
as following modification, the _mosquitto_socket_close() function should be called.
with this fix, I can remove socket leakage problem in mosquitto library.
static int _mosquitto_reconnect(struct mosquitto *mosq, bool blocking)
{
...
#ifdef WITH_SOCKS
if(mosq->socks5_host){
rc = _mosquitto_socket_connect(mosq, mosq->socks5_host, mosq->socks5_port, mosq->bind_address, blocking);
}else
#endif
{
if(mosq->sock != INVALID_SOCKET){
_mosquitto_socket_close(mosq); //close socket
}
rc = _mosquitto_socket_connect(mosq, mosq->host, mosq->port, mosq->bind_address, blocking);
}
The text was updated successfully, but these errors were encountered: