Commit 4e28ba7e authored by Honfika's avatar Honfika

fix for #321

parent bfd6e9e8
...@@ -692,13 +692,19 @@ namespace Titanium.Web.Proxy ...@@ -692,13 +692,19 @@ namespace Titanium.Web.Proxy
endPoint.Port = ((IPEndPoint)endPoint.Listener.LocalEndpoint).Port; endPoint.Port = ((IPEndPoint)endPoint.Listener.LocalEndpoint).Port;
while (true) while (proxyRunning)
{ {
TcpClient tcpClient = await endPoint.Listener.AcceptTcpClientAsync(); try
if (tcpClient != null) {
Task.Run(async () => HandleClient(tcpClient, endPoint)); TcpClient tcpClient = await endPoint.Listener.AcceptTcpClientAsync();
if (tcpClient != null)
Task.Run(async () => HandleClient(tcpClient, endPoint));
}
catch (ObjectDisposedException)
{
// proxy was stopped
}
} }
} }
#endif #endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment