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
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more