Exemple #1
0
        private async Task <MemcachedConnection> CreateConnection()
        {
            IPAddress address = _ip;

            if (address == null)
            {
                var addresses = await DnsExtensions.GetHostAddressesAsync(_host);

                address = addresses.First();
            }
            var endpoint = new IPEndPoint(address, _port);
            var conn     = new MemcachedConnection(endpoint, _receiveTimeout);
            await conn.Open(_connectTimeout);

            return(conn);
        }
Exemple #2
0
 private static bool ValidateConnection(MemcachedConnection connection)
 {
     return(connection.State == MemcachedConnectionState.Open);
 }