use std::time::Duration;
#[derive(Debug, Clone)]
#[non_exhaustive] pub enum SocketEvent {
Listening { endpoint: String },
BindFailed { endpoint: String, error_msg: String },
Accepted { endpoint: String, peer_addr: String },
AcceptFailed { endpoint: String, error_msg: String },
Connected { endpoint: String, peer_addr: String },
ConnectDelayed { endpoint: String, error_msg: String },
ConnectRetried { endpoint: String, interval: Duration },
ConnectFailed { endpoint: String, error_msg: String },
Closed { endpoint: String },
Disconnected { endpoint: String },
HandshakeFailed { endpoint: String, error_msg: String },
HandshakeSucceeded { endpoint: String },
}
pub type MonitorSender = fibre::mpmc::AsyncSender<SocketEvent>;
pub type MonitorReceiver = fibre::mpmc::AsyncReceiver<SocketEvent>;
pub const DEFAULT_MONITOR_CAPACITY: usize = 100;