Struct webrtc_sctp::association::Association
source · pub struct Association { /* private fields */ }
Expand description
Association represents an SCTP association 13.2. Parameters Necessary per Association (i.e., the TCB) Peer : Tag value to be sent in every packet and is received Verification: in the INIT or INIT ACK chunk. Tag :
My : Tag expected in every inbound packet and sent in the Verification: INIT or INIT ACK chunk.
Tag : State : A state variable indicating what state the association : is in, i.e., COOKIE-WAIT, COOKIE-ECHOED, ESTABLISHED, : SHUTDOWN-PENDING, SHUTDOWN-SENT, SHUTDOWN-RECEIVED, : SHUTDOWN-ACK-SENT.
No Closed state is illustrated since if a association is Closed its TCB SHOULD be removed.
Implementations§
source§impl Association
impl Association
sourcepub async fn server(config: Config) -> Result<Self, Error>
pub async fn server(config: Config) -> Result<Self, Error>
server accepts a SCTP stream over a conn
sourcepub async fn client(config: Config) -> Result<Self, Error>
pub async fn client(config: Config) -> Result<Self, Error>
Client opens a SCTP stream over a conn
sourcepub async fn shutdown(&self) -> Result<(), Error>
pub async fn shutdown(&self) -> Result<(), Error>
Shutdown initiates the shutdown sequence. The method blocks until the shutdown sequence is completed and the connection is closed, or until the passed context is done, in which case the context’s error is returned.
sourcepub async fn close(&self) -> Result<(), Error>
pub async fn close(&self) -> Result<(), Error>
Close ends the SCTP Association and cleans up any state
sourcepub fn bytes_sent(&self) -> usize
pub fn bytes_sent(&self) -> usize
bytes_sent returns the number of bytes sent
sourcepub fn bytes_received(&self) -> usize
pub fn bytes_received(&self) -> usize
bytes_received returns the number of bytes received
sourcepub async fn open_stream(
&self,
stream_identifier: u16,
default_payload_type: PayloadProtocolIdentifier
) -> Result<Arc<Stream>, Error>
pub async fn open_stream( &self, stream_identifier: u16, default_payload_type: PayloadProtocolIdentifier ) -> Result<Arc<Stream>, Error>
open_stream opens a stream
sourcepub async fn accept_stream(&self) -> Option<Arc<Stream>>
pub async fn accept_stream(&self) -> Option<Arc<Stream>>
accept_stream accepts a stream
sourcepub fn max_message_size(&self) -> u32
pub fn max_message_size(&self) -> u32
max_message_size returns the maximum message size you can send.
sourcepub fn set_max_message_size(&self, max_message_size: u32)
pub fn set_max_message_size(&self, max_message_size: u32)
set_max_message_size sets the maximum message size you can send.