pub struct DataChannelMessage {
pub association_handle: usize,
pub stream_id: u16,
pub ppi: PayloadProtocolIdentifier,
pub payload: BytesMut,
pub negotiated: bool,
}Expand description
DataChannelMessage is used for data sent over SCTP.
Fields§
§association_handle: usizeIdentifies the SCTP association this message belongs to.
stream_id: u16The SCTP stream the message arrived on or should be sent on.
ppi: PayloadProtocolIdentifierThe payload protocol identifier, which distinguishes DCEP control messages from string and binary user data.
payload: BytesMutThe message bytes.
negotiated: boolMarks a DATA_CHANNEL_OPEN that belongs to an out-of-band negotiated
channel (W3C WebRTC RTCDataChannelInit.negotiated). Such a message is
only used to open and configure the local SCTP stream and must not be
transmitted to the peer, which already created its own channel with the
pre-agreed stream id. Ignored for every other message.
Implementations§
Trait Implementations§
Source§impl Clone for DataChannelMessage
impl Clone for DataChannelMessage
Source§impl Debug for DataChannelMessage
impl Debug for DataChannelMessage
Source§impl Default for DataChannelMessage
impl Default for DataChannelMessage
Source§impl Protocol<DataChannelMessage, DataChannelMessage, ()> for DataChannel
impl Protocol<DataChannelMessage, DataChannelMessage, ()> for DataChannel
Source§fn handle_read(&mut self, msg: DataChannelMessage) -> Result<()>
fn handle_read(&mut self, msg: DataChannelMessage) -> Result<()>
Takes one message the peer sent on this channel’s stream: a DCEP message is processed
here, and a user message is queued for poll_read.
An error means the peer broke the protocol on this channel (a DATA_CHANNEL_OPEN on a
stream in use, a DCEP message that does not parse, an unsupported PPID): RFC 8832
section 6 and RFC 8831 section 6.6 have the receiver close the channel. Such a message
is neither delivered nor counted.
Source§fn handle_write(&mut self, msg: DataChannelMessage) -> Result<()>
fn handle_write(&mut self, msg: DataChannelMessage) -> Result<()>
handle_write writes len(p) bytes from p
Source§fn poll_write(&mut self) -> Option<DataChannelMessage>
fn poll_write(&mut self) -> Option<DataChannelMessage>
Returns packets to transmit
Source§fn close(&mut self) -> Result<()>
fn close(&mut self) -> Result<()>
Close closes the DataChannel and the underlying SCTP stream.