pub(crate) struct TcpListenerState {
pub(crate) socket: SocketHandle,
pub(crate) port: u16,
pub(crate) auto_relisten: bool,
pub(crate) session: Option<SocketHandle>,
pub(crate) backlog: [Option<SocketHandle>; 4],
pub(crate) eof: bool,
}Fields§
§socket: SocketHandleSocket that is always kept in LISTEN on port (except for the
instant between handshake detection and replacement).
port: u16§auto_relisten: bool§session: Option<SocketHandle>Accepted connection currently served by this fid, if any.
backlog: [Option<SocketHandle>; 4]Accepted connections waiting for session to finish.
eof: boolSet when a session ended and the next read should report EOF (0 bytes).
Implementations§
Source§impl TcpListenerState
impl TcpListenerState
pub(crate) fn new(socket: SocketHandle, port: u16, auto_relisten: bool) -> Self
Sourcepub(crate) fn backlog_len(&self) -> usize
pub(crate) fn backlog_len(&self) -> usize
Number of queued connections (diagnostics only).
Sourcepub(crate) fn push_backlog(&mut self, handle: SocketHandle) -> bool
pub(crate) fn push_backlog(&mut self, handle: SocketHandle) -> bool
Queue an accepted connection. Returns false when the backlog is full.
Sourcepub(crate) fn pop_backlog(&mut self) -> Option<SocketHandle>
pub(crate) fn pop_backlog(&mut self) -> Option<SocketHandle>
Take the oldest queued connection.
Trait Implementations§
Source§impl Clone for TcpListenerState
impl Clone for TcpListenerState
impl Copy for TcpListenerState
Auto Trait Implementations§
impl Forget for TcpListenerState
impl Freeze for TcpListenerState
impl Move for TcpListenerState
impl RefUnwindSafe for TcpListenerState
impl Send for TcpListenerState
impl Sync for TcpListenerState
impl Unpin for TcpListenerState
impl UnsafeUnpin for TcpListenerState
impl UnwindSafe for TcpListenerState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more