/// Accept an incoming connection on this socket, with the provided credentials.
///
/// The socket holds a queue of incoming connections. This function reads the first entry from
/// the queue (if any) and creates and returns the server end of the connection.
///
/// Returns an error if the socket is not listening or if the queue is empty.
Accept an incoming connection on this socket, with the provided credentials.
The socket holds a queue of incoming connections. This function reads the first entry from
the queue (if any) and creates and returns the server end of the connection.

Returns an error if the socket is not listening or if the queue is empty.
Accept an incoming connection on this socket with the provided credentials . The socket holds a queue of incoming connections . This function reads the first entry from the queue ( if any ) and creates and returns the server end of the connection . Returns an error if the socket is not listening or if the queue is empty .
fn accept(&self, socket: &Socket, credentials: ucred) -> Result<SocketHandle, Errno> {
        let mut inner = socket.lock();
        let queue = match &mut inner.state {
            SocketState::Listening(queue) => queue,
            _ => return error!(EINVAL),
        };
        let socket = queue.sockets.pop_front().ok_or(errno!(EAGAIN))?;
        socket.lock().credentials = Some(credentials);
        Ok(socket)
    }
fn accept ( & self , socket : & Socket , credentials : ucred ) -> Result < SocketHandle , Errno > { let mut inner = socket . lock ( ) ; let queue = match & mut inner . state { SocketState :: Listening ( queue ) => queue , _ => return error ! ( EINVAL ) , } ; let socket = queue . sockets . pop_front ( ) . ok_or ( errno ! ( EAGAIN ) ) ? ; socket . lock ( ) . credentials = Some ( credentials ) ; Ok ( socket ) }
Accept an incoming connection on this socket, with the provided credentials.
Accept an incoming connection on this socket with the provided credentials .
&self
socket
&Socket
credentials
ucred