fn try_new(server_socket: &CrasServerSocket) -> Result<CrasClientMessage> {
        let mut message: Self = Default::default();
        let (len, fd_nums) = server_socket.recv_with_fds(&mut message.data, &mut message.fds)?;

        if len < mem::size_of::<cras_client_message>() {
            Err(Error::MessageTruncated)
        } else {
            message.len = len;
            message.check_fd_nums(fd_nums)?;
            Ok(message)
        }
    }
// Reads a message from server_socket and checks validity of the read result
Reads a message from server_socket and checks validity of the read result
Reads a message from server_socket and checks validity of the read result
fn try_new(server_socket: &CrasServerSocket) -> Result<CrasClientMessage> {
        let mut message: Self = Default::default();
        let (len, fd_nums) = server_socket.recv_with_fds(&mut message.data, &mut message.fds)?;
        if len < mem::size_of::<cras_client_message>() {
            Err(Error::MessageTruncated)
        } else {
            message.len = len;
            message.check_fd_nums(fd_nums)?;
            Ok(message)
        }
    }
fn try_new ( server_socket : & CrasServerSocket ) -> Result < CrasClientMessage > { let mut message : Self = Default :: default ( ) ; let ( len , fd_nums ) = server_socket . recv_with_fds ( & mut message . data , & mut message . fds ) ? ; if len < mem :: size_of :: < cras_client_message > ( ) { Err ( Error :: MessageTruncated ) } else { message . len = len ; message . check_fd_nums ( fd_nums ) ? ; Ok ( message ) } }
Reads a message from server_socket and checks validity of the read result
Reads a message from server_socket and checks validity of the read result
server_socket
&CrasServerSocket
server_socket
&CrasServerSocket