From ead5f7f3f13635ecf34d29a79a95d1b754d71a11 Mon Sep 17 00:00:00 2001 From: Mike Olsen Date: Wed, 24 Aug 2016 23:47:58 -0700 Subject: [PATCH] Revert "added RestartAfterListenError" --- src/Fleck/WebSocketServer.cs | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/src/Fleck/WebSocketServer.cs b/src/Fleck/WebSocketServer.cs index b359edbf..eb5cda3a 100644 --- a/src/Fleck/WebSocketServer.cs +++ b/src/Fleck/WebSocketServer.cs @@ -43,7 +43,6 @@ public WebSocketServer(int port, string location) public X509Certificate2 Certificate { get; set; } public SslProtocols EnabledSslProtocols { get; set; } public IEnumerable SupportedSubProtocols { get; set; } - public bool RestartAfterListenError { get; set; } public bool IsSecure { @@ -100,24 +99,7 @@ public void Start(Action config) private void ListenForClients() { - ListenerSocket.Accept(OnClientConnect, e => { - + FleckLog.Error("Listener socket is closed", e); - + if(RestartAfterListenError){ - + FleckLog.Info("Listener socket restarting"); - + try - + { - + ListenerSocket.Dispose(); - + var socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.IP); - + ListenerSocket = new SocketWrapper(socket); - + Start(_config); - + FleckLog.Info("Listener socket restarted"); - + } - + catch (Exception ex) - + { - + FleckLog.Error("Listener could not be restarted", ex); - + } - + } - + }); + ListenerSocket.Accept(OnClientConnect, e => FleckLog.Error("Listener socket is closed", e)); } private void OnClientConnect(ISocket clientSocket)