dispose prematurely discon sockets
parent
402186844c
commit
4bc74139a4
|
@ -140,6 +140,11 @@ namespace OSHttpServer
|
|||
m_listener.BeginAcceptSocket(OnAccept, null);
|
||||
beginAcceptCalled = true;
|
||||
Socket socket = m_listener.EndAcceptSocket(ar);
|
||||
if (!socket.Connected)
|
||||
{
|
||||
socket.Dispose();
|
||||
return;
|
||||
}
|
||||
|
||||
if (!OnAcceptingSocket(socket))
|
||||
{
|
||||
|
@ -147,6 +152,9 @@ namespace OSHttpServer
|
|||
return;
|
||||
}
|
||||
|
||||
if(socket.Connected)
|
||||
{
|
||||
|
||||
m_logWriter.Write(this, LogPrio.Debug, "Accepted connection from: " + socket.RemoteEndPoint);
|
||||
|
||||
if (m_certificate != null)
|
||||
|
@ -154,6 +162,9 @@ namespace OSHttpServer
|
|||
else
|
||||
m_contextFactory.CreateContext(socket);
|
||||
}
|
||||
else
|
||||
socket.Dispose();
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
m_logWriter.Write(this, LogPrio.Debug, err.Message);
|
||||
|
|
Loading…
Reference in New Issue