Commit c3ea47bb authored by Marc Gravell's avatar Marc Gravell

suggested fix for #900; Nick to review please

parent 596713b7
......@@ -125,7 +125,12 @@ private void Dispose(bool disposing)
internal static Socket CreateSocket(EndPoint endpoint)
{
var protocolType = endpoint.AddressFamily == AddressFamily.Unix ? ProtocolType.Unspecified : ProtocolType.Tcp;
var socket = new Socket(endpoint.AddressFamily, SocketType.Stream, protocolType);
var addressFamily = endpoint.AddressFamily;
if (addressFamily == AddressFamily.Unspecified && endpoint is DnsEndPoint)
{ // default DNS to ipv4 if not specified explicitly
addressFamily = AddressFamily.InterNetwork;
}
var socket = new Socket(addressFamily, SocketType.Stream, protocolType);
SocketConnection.SetRecommendedClientOptions(socket);
return socket;
}
......
......@@ -6,7 +6,14 @@
static class Program
{
static async Task Main()
static void Main()
{
using (var muxer = ConnectionMultiplexer.Connect("localhost:6379", Console.Out))
{
muxer.GetDatabase().Ping();
}
}
static async Task Main2()
{
const int ClientCount = 150, ConnectionCount = 10;
CancellationTokenSource cancel = new CancellationTokenSource();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment