From 598e595ea8c9218198d918472337432e75a7cc55 Mon Sep 17 00:00:00 2001 From: Jesper Date: Sat, 17 Sep 2016 17:21:11 +0200 Subject: [PATCH] fix for incompatible address on restart (#186) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously when a listener would restart because of an error while on an IPv6 address it would give an error ‘An address incompatible with the requested protocol was used’. This fixes the issue. --- src/Fleck/WebSocketServer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Fleck/WebSocketServer.cs b/src/Fleck/WebSocketServer.cs index 03a609c9..d2fafb40 100644 --- a/src/Fleck/WebSocketServer.cs +++ b/src/Fleck/WebSocketServer.cs @@ -107,7 +107,7 @@ private void ListenForClients() try { ListenerSocket.Dispose(); - var socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.IP); + var socket = new Socket(_locationIP.AddressFamily, SocketType.Stream, ProtocolType.IP); ListenerSocket = new SocketWrapper(socket); Start(_config); FleckLog.Info("Listener socket restarted");