Skip to content

Commit

Permalink
moved RestartAfterListenError
Browse files Browse the repository at this point in the history
moved RestartAfterListenError to the WebSocketServer class
  • Loading branch information
Jesper committed Aug 24, 2016
1 parent ca00a01 commit 00866bb
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 9 deletions.
1 change: 0 additions & 1 deletion src/Fleck/Interfaces/ISocket.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ public interface ISocket
int RemotePort { get; }
Stream Stream { get; }
bool NoDelay { get; set; }
bool RestartAfterListenError { get; set; }
EndPoint LocalEndPoint { get; }

Task<ISocket> Accept(Action<ISocket> callback, Action<Exception> error);
Expand Down
7 changes: 0 additions & 7 deletions src/Fleck/SocketWrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ public class SocketWrapper : ISocket
private Stream _stream;
private CancellationTokenSource _tokenSource;
private TaskFactory _taskFactory;
private bool _restartAfterListenError;

public string RemoteIpAddress
{
Expand Down Expand Up @@ -87,12 +86,6 @@ public bool NoDelay
set { _socket.NoDelay = value; }
}

public bool RestartAfterListenError
{
get { return _restartAfterListenError; }
set { _restartAfterListenError = value; }
}

public EndPoint LocalEndPoint
{
get { return _socket.LocalEndPoint; }
Expand Down
3 changes: 2 additions & 1 deletion src/Fleck/WebSocketServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public WebSocketServer(int port, string location)
public X509Certificate2 Certificate { get; set; }
public SslProtocols EnabledSslProtocols { get; set; }
public IEnumerable<string> SupportedSubProtocols { get; set; }
public bool RestartAfterListenError {get; set; }

public bool IsSecure
{
Expand Down Expand Up @@ -101,7 +102,7 @@ private void ListenForClients()
{
ListenerSocket.Accept(OnClientConnect, e => {
FleckLog.Error("Listener socket is closed", e);
if(ListenerSocket.RestartAfterListenError){
if(RestartAfterListenError){
FleckLog.Info("Listener socket restarting");
try
{
Expand Down

0 comments on commit 00866bb

Please sign in to comment.