Skip to content

Commit

Permalink
Merge 73d3dfb into 7313336
Browse files Browse the repository at this point in the history
  • Loading branch information
dirvine committed Mar 20, 2023
2 parents 7313336 + 73d3dfb commit 9e6b04b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/endpoint.rs
Expand Up @@ -100,9 +100,11 @@ impl Endpoint {
}
}

/// Close all the connections of this endpoint immediately and stop accepting new connections.
pub fn close(&self) {
/// Clean up endpoint resources.
/// Will do so cleanly and wait for all incoming connections to close.
pub async fn close(&self) {
trace!("Closing endpoint");
self.inner.wait_idle().await; // wait for all connections to close
self.inner.close(0_u32.into(), b"Endpoint closed")
}

Expand Down

0 comments on commit 9e6b04b

Please sign in to comment.