Browse Source

don't throw exception if local bind fails

pull/1656/head
orignal 4 years ago
parent
commit
a8e1cd9a13
  1. 6
      libi2pd_client/I2PTunnel.cpp

6
libi2pd_client/I2PTunnel.cpp

@ -84,7 +84,11 @@ namespace client @@ -84,7 +84,11 @@ namespace client
// bind to 127.x.x.x address
// where x.x.x are first three bytes from ident
auto ourIP = GetLoopbackAddressFor(addr);
sock->bind (boost::asio::ip::tcp::endpoint (ourIP, 0));
boost::system::error_code ec;
sock->bind (boost::asio::ip::tcp::endpoint (ourIP, 0), ec);
if (ec)
LogPrint (eLogError, "I2PTunnel: can't bind ourIP to ", ourIP.to_string (), ": ", ec.message ());
}
#endif

Loading…
Cancel
Save