mirror of
https://github.com/savoirfairelinux/opendht.git
synced 2026-11-08 04:21:51 +00:00
dhtrunner: print proper message on bind error
This commit is contained in:
1 parent
c7604fbb8d
commit
d0fdbe5340
1 file changed
+1
@@ -460,6 +460,7 @@ int bindSocket(const SockAddr& addr, SockAddr& bound)
|
||||
setsockopt(sock, IPPROTO_IPV6, IPV6_V6ONLY, (const char*)&set, sizeof(set));
|
||||
int rc = bind(sock, addr.get(), addr.getLength());
|
||||
if(rc < 0) {
|
||||
rc = errno;
|
||||
close(sock);
|
||||
throw DhtException("Can't bind socket on " + addr.toString() + " " + strerror(rc));
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user