pub fn handle(&self, eid: sgx_enclave_id_t, responder: &zmq::Socket, msg: &str) -> Result<(bool), Error> {
        let mut keep_running: bool = true;

        let v: Value = serde_json::from_str(msg)?;

        let cmd: constants::Command = v["cmd"].as_str().unwrap().into();
        let result = match cmd {
            constants::Command::Execevm => self.handle_execevm(eid, &v).unwrap(),
            constants::Command::GetRegister => self.handle_get_register(eid).unwrap(),
            constants::Command::Stop => {
                keep_running = false;
                self.handle_stop().unwrap()
            }
            constants::Command::Unknown => {
                println!("[-] Server unkown command ");
                self.handle_unkown(&v)?
            }
        };
        responder.send(&result, 0).unwrap();
        Ok(keep_running)
    }
// public function to handle the surface requests
public function to handle the surface requests
public function to handle the surface requests
pub fn handle(&self, eid: sgx_enclave_id_t, responder: &zmq::Socket, msg: &str) -> Result<(bool), Error> {
        let mut keep_running: bool = true;
        let v: Value = serde_json::from_str(msg)?;
        let cmd: constants::Command = v["cmd"].as_str().unwrap().into();
        let result = match cmd {
            constants::Command::Execevm => self.handle_execevm(eid, &v).unwrap(),
            constants::Command::GetRegister => self.handle_get_register(eid).unwrap(),
            constants::Command::Stop => {
                keep_running = false;
                self.handle_stop().unwrap()
            }
            constants::Command::Unknown => {
                println!("[-] Server unkown command ");
                self.handle_unkown(&v)?
            }
        };
        responder.send(&result, 0).unwrap();
        Ok(keep_running)
    }
pub fn handle ( & self , eid : sgx_enclave_id_t , responder : & zmq :: Socket , msg : & str ) -> Result < ( bool ) , Error > { let mut keep_running : bool = true ; let v : Value = serde_json :: from_str ( msg ) ? ; let cmd : constants :: Command = v [ " " ] . as_str ( ) . unwrap ( ) . into ( ) ; let result = match cmd { constants :: Command :: Execevm => self . handle_execevm ( eid , & v ) . unwrap ( ) , constants :: Command :: GetRegister => self . handle_get_register ( eid ) . unwrap ( ) , constants :: Command :: Stop => { keep_running = false ; self . handle_stop ( ) . unwrap ( ) } constants :: Command :: Unknown => { println ! ( " " ) ; self . handle_unkown ( & v ) ? } } ; responder . send ( & result , 0 ) . unwrap ( ) ; Ok ( keep_running ) }
public function to handle the surface requests
public function to handle the surface requests
&self
eid
sgx_enclave_id_t
responder
&zmq::Socket
msg
&str
&self
eid
sgx_enclave_id_t
responder
&zmq::Socket
msg
&str