Skip to content

Commit a4ad7a2

Browse files
authored
docs(iroh-net): Explain when sockets are closed (#2892)
## Description This explains when the UDP sockets are closed in the Endpoint::close docs. ## Breaking Changes <!-- Optional, if there are any breaking changes document them, including how to migrate older code. --> ## Notes & open questions <!-- Any notes, remarks or open questions you have to make about the PR. --> ## Change checklist - [x] Self-review. - [x] Documentation updates following the [style guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text), if relevant. - [x] Tests if relevant. - [x] All breaking changes documented.
1 parent 1409bc4 commit a4ad7a2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

iroh-net/src/endpoint.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -957,8 +957,10 @@ impl Endpoint {
957957
/// This will close all open QUIC connections with the provided error_code and
958958
/// reason. See [`quinn::Connection`] for details on how these are interpreted.
959959
///
960-
/// It will then wait for all connections to actually be shutdown, and afterwards
961-
/// close the magic socket.
960+
/// It will then wait for all connections to actually be shutdown, and afterwards close
961+
/// the magic socket. Be aware however that the underlying UDP sockets are only closed
962+
/// on [`Drop`], bearing in mind the [`Endpoint`] is only dropped once all the clones
963+
/// are dropped.
962964
///
963965
/// Returns an error if closing the magic socket failed.
964966
/// TODO: Document error cases.

0 commit comments

Comments
 (0)