private function executeCommandInternal(IConnection $connection, Command $command) { $connection->writeCommand($command); if ($command->closesConnection()) { return $connection->disconnect(); } return $connection->readResponse($command); }