/** * 接收一条cmd * return cmd buffer on success or null on failure */ public function receive() { $res_body = $this->_connection->receive(); if (null != $res_body) { // 看看是否为标准错误包 $cmd_type = BigpipeFrame::get_command_type($res_body); if (BStompFrameType::ERROR == $cmd_type) { $recv_cmd = new BStompErrorFrame(); if ($recv_cmd->load($res_body)) { BigpipeLog::warning("[receive error ack frame][%s][error_code:%d]", $recv_cmd->error_message, $recv_cmd->error_no); } return null; } // end of 解析error frame } return $res_body; }