Struct sosistab::Listener [−][src]
pub struct Listener { /* fields omitted */ }
Expand description
A sosistab listener.
Implementations
Accepts a session. This function must be repeatedly called for the entire Listener to make any progress.
pub async fn listen_udp(
addr: SocketAddr,
long_sk: StaticSecret,
on_recv: impl Fn(usize, SocketAddr) + 'static + Send + Sync,
on_send: impl Fn(usize, SocketAddr) + 'static + Send + Sync
) -> Result<Self>
pub async fn listen_udp(
addr: SocketAddr,
long_sk: StaticSecret,
on_recv: impl Fn(usize, SocketAddr) + 'static + Send + Sync,
on_send: impl Fn(usize, SocketAddr) + 'static + Send + Sync
) -> Result<Self>
Creates a new listener given the parameters.
pub async fn listen_tcp(
addr: impl AsyncToSocketAddrs,
long_sk: StaticSecret,
on_recv: impl Fn(usize, SocketAddr) + 'static + Send + Sync,
on_send: impl Fn(usize, SocketAddr) + 'static + Send + Sync
) -> Result<Self>
pub async fn listen_tcp(
addr: impl AsyncToSocketAddrs,
long_sk: StaticSecret,
on_recv: impl Fn(usize, SocketAddr) + 'static + Send + Sync,
on_send: impl Fn(usize, SocketAddr) + 'static + Send + Sync
) -> Result<Self>
Creates a new listener given the parameters.
Obtains the stats of this listener
Gets the local address.
Auto Trait Implementations
impl RefUnwindSafe for Listener
impl UnwindSafe for Listener
Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more