Skip to content

Commit

Permalink
Updates docs for Connection::accept_bi() and Connection::open_bi()
Browse files Browse the repository at this point in the history
  • Loading branch information
rickvanprim committed Nov 10, 2023
1 parent ca0fae8 commit 267e647
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion quinn/src/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,12 @@ impl Connection {
///
/// Streams are cheap and instantaneous to open unless blocked by flow control. As a
/// consequence, the peer won't be notified that a stream has been opened until the stream is
/// actually used.
/// actually used. Calling [`open_bi()`] then waiting on the [`RecvStream`] without writing
/// anything to [`SendStream`] will never return.
///
/// [`open_bi()`]: crate::Connection::open_bi
/// [`SendStream`]: crate::SendStream
/// [`RecvStream`]: crate::RecvStream
pub fn open_bi(&self) -> OpenBi<'_> {
OpenBi {
conn: &self.0,
Expand All @@ -299,6 +304,15 @@ impl Connection {
}

/// Accept the next incoming bidirectional stream
///
/// **Important Note**: The `Connection` that calls [`open_bi()`] must write to its [`SendStream`]
/// before the other `Connection` is able to `accept_bi()`. Calling [`open_bi()`] then
/// waiting on the [`RecvStream`] without writing anything to [`SendStream`] will never return.
///
/// [`accept_bi()`]: crate::Connection::accept_bi
/// [`open_bi()`]: crate::Connection::open_bi
/// [`SendStream`]: crate::SendStream
/// [`RecvStream`]: crate::RecvStream
pub fn accept_bi(&self) -> AcceptBi<'_> {
AcceptBi {
conn: &self.0,
Expand Down

0 comments on commit 267e647

Please sign in to comment.