Struct sosistab::Session [−][src]
pub struct Session { /* fields omitted */ }
Expand description
This struct represents a session: a single end-to-end connection between a client and a server. This can be thought of as analogous to TcpStream
, except all reads and writes are datagram-based and unreliable. Session is thread-safe and can be wrapped in an Arc to be shared between threads.
Session should be used directly only if an unreliable connection is all you need. For most applications, use Multiplex, which wraps a Session and provides QUIC-like reliable streams as well as unreliable messages, all multiplexed over a single Session.
Implementations
Adds a closure to be run when the Session is dropped. This can be used to manage associated “worker” resources.
Takes a Buff to be sent and stuffs it into the session.
Waits until the next application input is decoded by the session.