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