_send_binary_packet() 공개 메소드

See '6. Binary Packet Protocol' of rfc4253 for more info.
또한 보기: self::_get_binary_packet()
public _send_binary_packet ( string $data, string $logged = null ) : boolean
$data string
$logged string
리턴 boolean
예제 #1
0
 /**
  * Request agent forwarding of remote server
  *
  * @param Net_SSH2 $ssh
  * @return bool
  * @access private
  */
 function _request_forwarding($ssh)
 {
     $request_channel = $ssh->_get_open_channel();
     if ($request_channel === false) {
         return false;
     }
     $packet = pack('CNNa*C', NET_SSH2_MSG_CHANNEL_REQUEST, $ssh->server_channels[$request_channel], strlen('*****@*****.**'), '*****@*****.**', 1);
     $ssh->channel_status[$request_channel] = NET_SSH2_MSG_CHANNEL_REQUEST;
     if (!$ssh->_send_binary_packet($packet)) {
         return false;
     }
     $response = $ssh->_get_channel_packet($request_channel);
     if ($response === false) {
         return false;
     }
     $ssh->channel_status[$request_channel] = NET_SSH2_MSG_CHANNEL_OPEN;
     $this->forward_status = SYSTEM_SSH_AGENT_FORWARD_ACTIVE;
     return true;
 }