private function connect()
    {
        $server = $this->config['server'];
        if (isset($this->config['ssl']) && $this->config['ssl'] == true) {
            $server = 'ssl://' . $server;
        }

        stream_set_blocking(STDIN, 0);
        $this->socket = fsockopen($server, $this->config['port']);

        return (bool) $this->socket;
    }