fn init_client_socket(
        local_addr: &SockAddr,
        log: &ReplicaLogger,
    ) -> Result<Socket, TransportErrorCode> {
        let domain = Self::socket_domain(local_addr);
        let socket = Socket::new(domain, Type::stream(), None).map_err(|e| {
            warn!(
                every_n_seconds => 30,
                log,
                "ControlPlane::connect(): Failed to create socket: local_addr = {:?} {:?}",
                local_addr,
                e
            );
            TransportErrorCode::ClientSocketCreateFailed
        })?;

        socket.bind(local_addr).map_err(|e| {
            warn!(
                every_n_seconds => 30,
                log,
                "ControlPlane::connect(): Failed to bind(): local_addr = {:?} {:?}",
                local_addr,
                e
            );
            TransportErrorCode::ClientSocketBindFailed
        })?;
        Ok(socket)
    }
/// Sets up the client side socket with the node IP address
Sets up the client side socket with the node IP address
Sets up the client side socket with the node IP address
fn init_client_socket(
        local_addr: &SockAddr,
        log: &ReplicaLogger,
    ) -> Result<Socket, TransportErrorCode> {
        let domain = Self::socket_domain(local_addr);
        let socket = Socket::new(domain, Type::stream(), None).map_err(|e| {
            warn!(
                every_n_seconds => 30,
                log,
                "ControlPlane::connect(): Failed to create socket: local_addr = {:?} {:?}",
                local_addr,
                e
            );
            TransportErrorCode::ClientSocketCreateFailed
        })?;
        socket.bind(local_addr).map_err(|e| {
            warn!(
                every_n_seconds => 30,
                log,
                "ControlPlane::connect(): Failed to bind(): local_addr = {:?} {:?}",
                local_addr,
                e
            );
            TransportErrorCode::ClientSocketBindFailed
        })?;
        Ok(socket)
    }
fn init_client_socket ( local_addr : & SockAddr , log : & ReplicaLogger , ) -> Result < Socket , TransportErrorCode > { let domain = Self :: socket_domain ( local_addr ) ; let socket = Socket :: new ( domain , Type :: stream ( ) , None ) . map_err ( | e | { warn ! ( every_n_seconds 30 log " " local_addr e ) ; TransportErrorCode :: ClientSocketCreateFailed } ) ? ; socket . bind ( local_addr ) . map_err ( | e | { warn ! ( every_n_seconds 30 log " " local_addr e ) ; TransportErrorCode :: ClientSocketBindFailed } ) ? ; Ok ( socket ) }
Sets up the client side socket with the node IP address
Sets up the client side socket with the node IP address
local_addr
&SockAddr
log
&ReplicaLogger
local_addr
&SockAddr
log
&ReplicaLogger