private function receive()
    {
        $timer = microtime(true);

        $str = fgets($this->socket);

        if ($str === false) {
            $this->close();
            throw new HSException('Cannot read from socket');
        }


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

        return substr($str, 0, -1);
    }