public function send($command)
    {
        $string = $command;

        $timer = microtime(true);

        while ($string) {
            $bytes = fwrite($this->socket, $string);

            if ($bytes === false) {
                $this->close();
                throw new HSException('Cannot write to socket');
            }

            if ($bytes === 0) {
                return null;
            }

            $string = substr($string, $bytes);
        }

        $this->logs[] = [
            'type' => 'sended',
            'time' => microtime(true) - $timer,
            'command' => $command
        ];

        return $this->receive();
    }