Handle exceptions thrown from Connection.Start in ListenerSecondary

- This is already done for primary listeners
This commit is contained in:
Stephen Halter 2016-06-07 17:07:14 -07:00
parent 8dbdc0294f
commit b4632c273e
5 changed files with 10 additions and 7 deletions

View File

@ -138,8 +138,16 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http
return;
}
var connection = new Connection(this, acceptSocket);
connection.Start();
try
{
var connection = new Connection(this, acceptSocket);
connection.Start();
}
catch (UvException ex)
{
Log.LogError(0, ex, "ListenerSecondary.OnConnection");
acceptSocket.Dispose();
}
}
/// <summary>

View File

@ -47,7 +47,6 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http
{
Log.LogError(0, ex, "PipeListener.OnConnection");
acceptSocket.Dispose();
return;
}
}
}

View File

@ -47,7 +47,6 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http
{
Log.LogError(0, ex, "ListenerPrimary.OnConnection");
acceptSocket.Dispose();
return;
}
}
}

View File

@ -53,7 +53,6 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http
{
Log.LogError(0, ex, "TcpListener.OnConnection");
acceptSocket.Dispose();
return;
}
}
}

View File

@ -48,13 +48,11 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http
acceptSocket.NoDelay(ServerOptions.NoDelay);
listenSocket.Accept(acceptSocket);
DispatchConnection(acceptSocket);
}
catch (UvException ex)
{
Log.LogError(0, ex, "TcpListenerPrimary.OnConnection");
acceptSocket.Dispose();
return;
}
}
}