lib/avro/ipc.php
public function read_handshake_response(AvroIOBinaryDecoder $decoder)
  {
    // if the handshake has been successfully made previously,
    // no need to do it again
    if ($this->transceiver->is_connected())
      return true;
    
    $established = false;
    $handshake_response = $this->handshake_requestor_reader->read($decoder);
    $match = $handshake_response["match"];
    
    switch ($match) {
      case 'BOTH':
        $established = true;
        $this->send_protocol = false;
        break;
      case 'CLIENT':
        $established = true;
        $this->send_protocol = false;
        $this->set_remote($handshake_response);
        break;
      case 'NONE':
        $this->send_protocol = true;
        $this->set_remote($handshake_response);
        $established = false;
        break;
      default:
        throw new AvroException("Bad handshake response match: $match");
    }
    
    if ($established)
      $this->transceiver->set_remote($this->remote);
    
    return $established;
  }
public function read_handshake_response(AvroIOBinaryDecoder $decoder)
  {
    // if the handshake has been successfully made previously,
    // no need to do it again
    if ($this->transceiver->is_connected())
      return true;
    
    $established = false;
    $handshake_response = $this->handshake_requestor_reader->read($decoder);
    $match = $handshake_response["match"];
    
    switch ($match) {
      case 'BOTH':
        $established = true;
        $this->send_protocol = false;
        break;
      case 'CLIENT':
        $established = true;
        $this->send_protocol = false;
        $this->set_remote($handshake_response);
        break;
      case 'NONE':
        $this->send_protocol = true;
        $this->set_remote($handshake_response);
        $established = false;
        break;
      default:
        throw new AvroException("Bad handshake response match: $match");
    }
    
    if ($established)
      $this->transceiver->set_remote($this->remote);
    
    return $established;
  }
public function read_handshake_response ( AvroIOBinaryDecoder $ decoder ) { // if the handshake has been successfully made previously, // no need to do it again if ( $ this -> transceiver -> is_connected ( ) ) return true ; $ established = false ; $ handshake_response = $ this -> handshake_requestor_reader -> read ( $ decoder ) ; $ match = $ handshake_response [ "match" ] ; switch ( $ match ) { case 'BOTH' : $ established = true ; $ this -> send_protocol = false ; break ; case 'CLIENT' : $ established = true ; $ this -> send_protocol = false ; $ this -> set_remote ( $ handshake_response ) ; break ; case 'NONE' : $ this -> send_protocol = true ; $ this -> set_remote ( $ handshake_response ) ; $ established = false ; break ; default : throw new AvroException ( "Bad handshake response match: $match" ) ; } if ( $ established ) $ this -> transceiver -> set_remote ( $ this -> remote ) ; return $ established ; }
Reads and processes the handshake response message.
@param AvroIOBinaryDecoder $decoder : Decoder to read messages from.
@return boolean true if a response exists.
@throw  AvroException when server respond an unknown handshake match
Reads and processes the handshake response message .