@param string $networkMode

@return Client
485208
public function setNetworkMode(string $networkMode)
    {
        $this->networkMode = $networkMode;

        $this->hostConfig = array_merge($this->hostConfig, ['NetworkMode' => $networkMode]);

        return $this;
    }
1208451
public function make(array $config): SearchClient
    {
        $config = $this->getConfig($config);

        return $this->getClient($config);
    }
998644
public function getClient(): ClientInterface
    {
        if ($this->client === null) {
            $this->client = new Client();
        }

        return $this->client;
    }
591216
public function setClient(Client $client)
    {
        // Assign the client.
        $this->client = $client;
        $this->client->setDefaultOption('headers', ['Content-Type' => 'application/json']);

        // Allow chaining.
        return $this;
    }
1081152
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $puppetDbClient = new Client();

        $options = $serviceLocator->get('KmbPuppetDb\Options\ModuleOptions');

        $httpClient = $serviceLocator->get('KmbPuppetDb\Http\Client');
        $httpClient->setOptions($options->getHttpOptions());

        $puppetDbClient->setHttpClient($httpClient);
        $puppetDbClient->setOptions($options);
        $puppetDbClient->setLogger($serviceLocator->get('Logger'));

        return $puppetDbClient;
    }
277932
public function getClientBySpaceId(string $spaceId): ?Client
    {
        foreach ($this->clientsConfig as $clientConfig) {
            if ($clientConfig['space'] === $spaceId) {
                return $clientConfig['service'];
            }
        }

        return null;
    }
852225
public static Class<? extends ServerChannel> getServerChannelClass(IOMode mode) {
    switch (mode) {
      case NIO:
        return NioServerSocketChannel.class;
      case EPOLL:
        return EpollServerSocketChannel.class;
      default:
        throw new IllegalArgumentException("Unknown io mode: " + mode);
    }
  }
664052
protected function createClient()
    {
        $client = new MultiCurl();
        $client->setVerifyPeer(false);

        $this->serviceClient = new Browser($client);

        return $this;
    }
886574
public function setMode($mode)
    {
        Assertion::choice($mode, $this->availableModes, "Mode '{$mode}' does not exist.");
        $this->mode = $mode;

        return $this;
    }
1301523
public function setHttpClient(Client $client = null)
    {
        if ($client === null) {
            $client = new Client(
                HttpClientDiscovery::find(),
                MessageFactoryDiscovery::find()
            );
        }
        $this->client = $client;
        return $this;
    }
3170
function getClient()
    {
        $transport = $this->getTransport();
        $transport->setAuth($this->username, $this->password);

        return new Client($transport);
    }
730480
public function client($client = null)
	{
		$client = $client ?: $this->getDefaultClient();

		// If the given driver has not been created before, we will create the instances
		// here and cache it so we can return it next time very quickly. If there is
		// already a driver created by this name, we'll just return that instance.
		if (!isset($this->routers[$client]))
		{
			$this->routers[$client] = $this->createRouter($client);
		}

		return $this->routers[$client];
	}
362632
public function client(array $config = array(), $lifetime = null)
    {    
        if(is_null($lifetime))
        {
            $lifetime = $this->lifetime;
        }

        $client = new Client($config);

        $emitter = $client->getEmitter();

        $subscriber = new CacheSubscriber($this->cache, $lifetime, $this->cachePrefix);

        $emitter->attach($subscriber);
        
        return $client;
    }
701314
public function createReply($mode, $dsn = null, $options = array())
    {
        return $this->createSocket(ZMQ::SOCKET_REP, $mode, $dsn, $options);
    }
904536
private function _getClient(): ClientInterface
    {
        if (! $this->client instanceof ClientInterface) $this->client = new Client($this->clientConfig);
        return $this->client;
    }
341413
public function createSubscriber($mode, $dsn = null, $subscribe = '', $options = array())
    {
        $options[ZMQ::SOCKOPT_SUBSCRIBE] = $subscribe;

        return $this->createSocket(ZMQ::SOCKET_SUB, $mode, $dsn, $options);
    }
623031
public static function factory($host, $port, $sendTimeout = null, $receiveTimeout = null, $framedTransport = false)
    {
        $socket = self::createSocket($host, $port, $sendTimeout, $receiveTimeout);
        $transport = self::createTransport($socket, $framedTransport);
        $protocol = new TBinaryProtocolAccelerated($transport);
        $client = new RestClient($protocol);
        $transport->open();

        return $client;
    }