protected function getMemcachedClient($host, $port = Client::DEFAULT_PORT, $timeout = null)
{
$uuid = $this->uuid($host, $port);
$clients = $this->getClients();
// Check if already exists ...
if (isset($clients[$uuid]) === false) {
$client = clone $this->getClient();
$client->host($host)->port($port);
// Check for custom timeout (maybe required when connecting outside localhost = more latency)
if (null !== $timeout && true === is_int($timeout) && $timeout >= 0) {
$client->timeout($timeout);
}
$clients[$uuid] = $client;
$this->setClients($clients);
} else {
$client = $this->clients[$uuid];
}
return $client;
}