diff --git a/libp2p/Common.h b/libp2p/Common.h index c9aee9a0e..51938e5f1 100644 --- a/libp2p/Common.h +++ b/libp2p/Common.h @@ -145,7 +145,7 @@ struct PeerSessionInfo unsigned short port; std::chrono::steady_clock::duration lastPing; std::set caps; - unsigned socket; + unsigned socketId; std::map notes; }; diff --git a/libp2p/Session.cpp b/libp2p/Session.cpp index 8c5a50750..0ea7c33e2 100644 --- a/libp2p/Session.cpp +++ b/libp2p/Session.cpp @@ -48,6 +48,7 @@ Session::Session(Host* _s, RLPXFrameIO* _io, std::shared_ptr const& _n, Pe { m_peer->m_lastDisconnect = NoDisconnect; m_lastReceived = m_connect = chrono::steady_clock::now(); + m_info.socketId = _io->socket().native_handle(); } Session::~Session() diff --git a/libp2p/Session.h b/libp2p/Session.h index 95053d2a9..be8422c82 100644 --- a/libp2p/Session.h +++ b/libp2p/Session.h @@ -65,7 +65,7 @@ public: bool isConnected() const { return m_socket.is_open(); } NodeId id() const; - unsigned socketId() const { return m_info.socket; } + unsigned socketId() const { return m_info.socketId; } template std::shared_ptr cap() const { try { return std::static_pointer_cast(m_capabilities.at(std::make_pair(PeerCap::name(), PeerCap::version()))); } catch (...) { return nullptr; } }