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.