public function createClient($address, $timeout = null)
    {
        $socket = $this->createFromString($address, $scheme);

        try {
            if ($timeout === null) {
                $socket->connect($address);
            } else {
                // connectTimeout enables non-blocking mode, so turn blocking on again
                $socket->connectTimeout($address, $timeout);
                $socket->setBlocking(true);
            }
        } catch (Exception $e) {
            $socket->close();
            throw $e;
        }

        return $socket;
    }