Struct sctp_proto::Endpoint
source · pub struct Endpoint { /* private fields */ }
Expand description
The main entry point to the library
This object performs no I/O whatsoever. Instead, it generates a stream of packets to send via
poll_transmit
, and consumes incoming packets and association-generated events via handle
and
handle_event
.
Implementations§
source§impl Endpoint
impl Endpoint
sourcepub fn new(
config: Arc<EndpointConfig>,
server_config: Option<Arc<ServerConfig>>
) -> Self
pub fn new(
config: Arc<EndpointConfig>,
server_config: Option<Arc<ServerConfig>>
) -> Self
Create a new endpoint
Returns Err
if the configuration is invalid.
sourcepub fn poll_transmit(&mut self) -> Option<Transmit>
pub fn poll_transmit(&mut self) -> Option<Transmit>
Get the next packet to transmit
sourcepub fn set_server_config(&mut self, server_config: Option<Arc<ServerConfig>>)
pub fn set_server_config(&mut self, server_config: Option<Arc<ServerConfig>>)
Replace the server configuration, affecting new incoming associations only
sourcepub fn handle_event(
&mut self,
ch: AssociationHandle,
event: EndpointEvent
) -> Option<AssociationEvent>
pub fn handle_event(
&mut self,
ch: AssociationHandle,
event: EndpointEvent
) -> Option<AssociationEvent>
Process EndpointEvent
s emitted from related Association
s
In turn, processing this event may return a AssociationEvent
for the same Association
.
sourcepub fn handle(
&mut self,
now: Instant,
remote: SocketAddr,
local_ip: Option<IpAddr>,
ecn: Option<EcnCodepoint>,
data: Bytes
) -> Option<(AssociationHandle, DatagramEvent)>
pub fn handle(
&mut self,
now: Instant,
remote: SocketAddr,
local_ip: Option<IpAddr>,
ecn: Option<EcnCodepoint>,
data: Bytes
) -> Option<(AssociationHandle, DatagramEvent)>
Process an incoming UDP datagram
sourcepub fn connect(
&mut self,
config: ClientConfig,
remote: SocketAddr
) -> Result<(AssociationHandle, Association), ConnectError>
pub fn connect(
&mut self,
config: ClientConfig,
remote: SocketAddr
) -> Result<(AssociationHandle, Association), ConnectError>
Initiate an Association
sourcepub fn reject_new_associations(&mut self)
pub fn reject_new_associations(&mut self)
Unconditionally reject future incoming associations
sourcepub fn config(&self) -> &EndpointConfig
pub fn config(&self) -> &EndpointConfig
Access the configuration used by this endpoint