Skip to content

Commit

Permalink
don't throw exception if local bind fails
Browse files Browse the repository at this point in the history
  • Loading branch information
orignal committed May 10, 2021
1 parent d6f5640 commit a8e1cd9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion libi2pd_client/I2PTunnel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit a8e1cd9

Please sign in to comment.