fn reply(&self, client: NodeId, data: Vec<u8>) -> Result<(), RPCError> {
        // Create response header
        let res_hdr = RPCHeader {
            client_id: client,
            pid: 0,    // dummy value, no real client ID
            req_id: 0, // dummy value, no real request ID
            msg_type: RPCType::Unknown,
            msg_len: data.len() as u64,
        };

        // Serialize request header then request body
        // We assume data is already serialized
        let mut res_data = Vec::new();
        unsafe { encode(&res_hdr, &mut res_data) }.unwrap();
        if data.len() > 0 {
            res_data.extend(data);
        }

        // Send the data
        self.tx
            .send(res_data)
            .map_err(|_my_err| RPCError::TransportError)
    }
/// replies an RPC call with results
replies an RPC call with results
replies an RPC call with results
fn reply(&self, client: NodeId, data: Vec<u8>) -> Result<(), RPCError> {
        // Create response header
        let res_hdr = RPCHeader {
            client_id: client,
            pid: 0,    // dummy value, no real client ID
            req_id: 0, // dummy value, no real request ID
            msg_type: RPCType::Unknown,
            msg_len: data.len() as u64,
        };
        // Serialize request header then request body
        // We assume data is already serialized
        let mut res_data = Vec::new();
        unsafe { encode(&res_hdr, &mut res_data) }.unwrap();
        if data.len() > 0 {
            res_data.extend(data);
        }
        // Send the data
        self.tx
            .send(res_data)
            .map_err(|_my_err| RPCError::TransportError)
    }
fn reply ( & self , client : NodeId , data : Vec < u8 > ) -> Result < ( ) , RPCError > { // Create response header let res_hdr = RPCHeader { client_id : client , pid : 0 , // dummy value, no real client ID req_id : 0 , // dummy value, no real request ID msg_type : RPCType :: Unknown , msg_len : data . len ( ) as u64 , } ; // Serialize request header then request body // We assume data is already serialized let mut res_data = Vec :: new ( ) ; unsafe { encode ( & res_hdr , & mut res_data ) } . unwrap ( ) ; if data . len ( ) > 0 { res_data . extend ( data ) ; } // Send the data self . tx . send ( res_data ) . map_err ( | _my_err | RPCError :: TransportError ) }
replies an RPC call with results
replies an RPC call with results
&self
client
NodeId
data
Vec<u8>
&self
client
NodeId
data
Vec<u8>