-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: implement eth handshake disconnects #1494
Conversation
Codecov Report
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more @@ Coverage Diff @@
## main #1494 +/- ##
==========================================
- Coverage 76.00% 75.94% -0.06%
==========================================
Files 358 358
Lines 42660 42689 +29
==========================================
- Hits 32423 32422 -1
- Misses 10237 10267 +30
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
async fn disconnect( | ||
&mut self, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using mut borrow is fine I guess, mimicks what TcpStream::shutdown
does as well.
and we likely need this mut borrow if we want to use it in Sink/Stream impls
This implements disconnects in the eth handshake by introducing the
CanDisconnect
trait, following the design in #1492The trait extends
Sink<T>
, with Default implementations forECIESStream
and allFramed<T, U>
that implementSink
. These implementations just close the sink usingSinkExt::close
.