pub enum Event {
Connect(SocketAddr),
Disconnect(SocketAddr),
Receive(SocketAddr, Box<[u8]>),
Error(SocketAddr, ErrorType),
}
Expand description
Used to signal connection events and deliver received packets.
Variants§
Connect(SocketAddr)
Indicates a successful connection from a client.
Disconnect(SocketAddr)
Indicates that a client has disconnected. A disconnection event is only produced if either party explicitly terminates an active connection.
Receive(SocketAddr, Box<[u8]>)
Signals a packet received from a client.
Error(SocketAddr, ErrorType)
Indicates that a connection has been terminated due to an unrecoverable error.