pub struct AcceptLoop { /* private fields */ }Expand description
Accept loop for network listeners.
The loop runs on its own threads and passes accepted connections to the server.
Implementations§
Source§impl AcceptLoop
impl AcceptLoop
Sourcepub fn new() -> AcceptLoop
pub fn new() -> AcceptLoop
Sourcepub fn name<T: AsRef<str>>(&mut self, name: T)
pub fn name<T: AsRef<str>>(&mut self, name: T)
Sets the server name.
The first accept thread is named {name}:accept, additional threads
are named {name}:accept{n}.
Sourcepub fn acceptors(&mut self, num: usize)
pub fn acceptors(&mut self, num: usize)
Sets the number of accept threads.
Every TCP listener is replicated with SO_REUSEPORT, so each accept
thread has its own socket for the same address and the kernel spreads
incoming connections between them. Unix domain listeners are served
by the first thread only.
Multiple accept threads are supported on Linux and Android. On other platforms, a single thread is used.
§Panics
Panics if a poller cannot be created.
Sourcepub fn notify(&self) -> AcceptNotify
pub fn notify(&self) -> AcceptNotify
Returns a handle for sending commands to the loop.
Trait Implementations§
Source§impl Debug for AcceptLoop
impl Debug for AcceptLoop
Auto Trait Implementations§
impl !RefUnwindSafe for AcceptLoop
impl !Sync for AcceptLoop
impl !UnwindSafe for AcceptLoop
impl Forget for AcceptLoop
impl Freeze for AcceptLoop
impl Send for AcceptLoop
impl Unpin for AcceptLoop
impl UnsafeUnpin for AcceptLoop
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