diff --git a/libp2p/RLPxHandshake.h b/libp2p/RLPxHandshake.h index 5e51aa4f8..47f6afb57 100644 --- a/libp2p/RLPxHandshake.h +++ b/libp2p/RLPxHandshake.h @@ -95,7 +95,7 @@ protected: void transition(boost::system::error_code _ech = boost::system::error_code()); /// Timeout for remote to respond to transition events. Enforced by m_idleTimer and refreshed by transition(). - boost::posix_time::milliseconds const c_timeout = boost::posix_time::milliseconds(1000); + boost::posix_time::milliseconds const c_timeout = boost::posix_time::milliseconds(1800); State m_nextState = New; ///< Current or expected state of transition. bool m_cancel = false; ///< Will be set to true if connection was canceled. diff --git a/libp2p/UDP.h b/libp2p/UDP.h index 338100c78..68160d053 100644 --- a/libp2p/UDP.h +++ b/libp2p/UDP.h @@ -163,7 +163,14 @@ void UDPSocket::connect() return; m_socket.open(bi::udp::v4()); - m_socket.bind(m_endpoint); + try + { + m_socket.bind(m_endpoint); + } + catch (...) + { + m_socket.bind(bi::udp::endpoint(bi::udp::v4(), m_endpoint.port())); + } // clear write queue so reconnect doesn't send stale messages Guard l(x_sendQ);