mirror of
https://github.com/OpenNebula/one.git
synced 2026-11-23 05:04:56 +09:00
M #-: Add SO_REUSEADDR to monitord socket
This commit is contained in:
1 file changed
+10
@@ -129,6 +129,16 @@ int TCPStream<E>::action_loop(int threads, std::string& error)
|
||||
return -1;
|
||||
}
|
||||
|
||||
int on = 1;
|
||||
|
||||
rc = setsockopt(_socket, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(int));
|
||||
|
||||
if ( rc == -1 )
|
||||
{
|
||||
error = strerror(errno);
|
||||
return -1;
|
||||
}
|
||||
|
||||
rc = bind(_socket, res->ai_addr, res->ai_addrlen);
|
||||
|
||||
freeaddrinfo(res);
|
||||
|
||||
Reference in new issue
Block a user