You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 28, 2021. It is now read-only.
According to the RLPX handshake spec, one should give clients 2 seconds to disconnect after sending a disconnect packet:
Inform the peer that a disconnection is imminent; if received, a peer should disconnect immediately. When sending, well-behaved hosts give their peers a fighting chance (read: wait 2 seconds) to disconnect to before disconnecting themselves.
However, Aleth closes the socket immediately (via Session::drop). This also means that the disconnect packet may not be sent - this is because Session::disconnect (and all of the functions it calls) is executed on the network thread, whereas the async_write may not execute immediately in which case I suspect it will execute after Session::disconnect / Session::drop:
According to the RLPX handshake spec, one should give clients 2 seconds to disconnect after sending a disconnect packet:
However, Aleth closes the socket immediately (via
Session::drop). This also means that the disconnect packet may not be sent - this is becauseSession::disconnect(and all of the functions it calls) is executed on the network thread, whereas theasync_writemay not execute immediately in which case I suspect it will execute afterSession::disconnect/Session::drop:aleth/libp2p/Session.cpp
Lines 299 to 310 in c630593
Here's where the actual socket write takes place (in
Session::write):aleth/libp2p/Session.cpp
Lines 237 to 256 in c630593