Skip to content
This repository was archived by the owner on Jul 9, 2023. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions src/Titanium.Web.Proxy/ProxyServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -777,8 +777,19 @@ private void onAcceptConnection(IAsyncResult asyn)
});
}

// Get the listener that handles the client request.
endPoint.Listener!.BeginAcceptSocket(onAcceptConnection, endPoint);
try
{
// based on end point type call appropriate request handlers
// Get the listener that handles the client request.
endPoint.Listener!.BeginAcceptSocket(onAcceptConnection, endPoint);
}
catch (Exception ex) when (ex is ObjectDisposedException || ex is InvalidOperationException)
{
// The listener was Stop()'d, disposing the underlying socket and
// triggering the completion of the callback. We're already exiting,
// so just return.
return;
}
}


Expand Down