Skip to content

Commit

Permalink
Fix setting socket local endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
pwojcikdev committed Jan 19, 2024
1 parent 64904d8 commit e2870fe
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions nano/node/transport/tcp_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,12 @@ void nano::transport::tcp_listener::on_connection (std::function<bool (std::shar

if (!ec_a)
{
{
// Best effort attempt to get endpoint addresses
boost::system::error_code ec;
new_connection->local = new_connection->tcp_socket.local_endpoint (ec);
}

// Make sure the new connection doesn't idle. Note that in most cases, the callback is going to start
// an IO operation immediately, which will start a timer.
new_connection->start ();
Expand Down

0 comments on commit e2870fe

Please sign in to comment.