Hopefully catch failed connections
This commit is contained in:
parent
7886cc120c
commit
2aed769ac7
|
@ -5,9 +5,9 @@
|
||||||
<PackageId>Tesses.WebServer</PackageId>
|
<PackageId>Tesses.WebServer</PackageId>
|
||||||
<Author>Mike Nolan</Author>
|
<Author>Mike Nolan</Author>
|
||||||
<Company>Tesses</Company>
|
<Company>Tesses</Company>
|
||||||
<Version>1.0.3.0</Version>
|
<Version>1.0.3.1</Version>
|
||||||
<AssemblyVersion>1.0.3.0</AssemblyVersion>
|
<AssemblyVersion>1.0.3.1</AssemblyVersion>
|
||||||
<FileVersion>1.0.3.0</FileVersion>
|
<FileVersion>1.0.3.1</FileVersion>
|
||||||
<Description>A TCP Listener HTTP(s) Server</Description>
|
<Description>A TCP Listener HTTP(s) Server</Description>
|
||||||
<PackageLicenseExpression>MIT</PackageLicenseExpression>
|
<PackageLicenseExpression>MIT</PackageLicenseExpression>
|
||||||
<PackageTags>HTTP, WebServer, Website</PackageTags>
|
<PackageTags>HTTP, WebServer, Website</PackageTags>
|
||||||
|
|
|
@ -872,8 +872,13 @@ namespace Tesses.WebServer
|
||||||
using (var r = token.Register(() => _listener.Stop())) {
|
using (var r = token.Register(() => _listener.Stop())) {
|
||||||
while (!token.IsCancellationRequested)
|
while (!token.IsCancellationRequested)
|
||||||
{
|
{
|
||||||
|
try{
|
||||||
var socket=await _listener.AcceptTcpClientAsync();
|
var socket=await _listener.AcceptTcpClientAsync();
|
||||||
await CommunicateHostAsync(socket).ConfigureAwait(false);
|
await CommunicateHostAsync(socket).ConfigureAwait(false);
|
||||||
|
}catch(Exception ex)
|
||||||
|
{
|
||||||
|
_=ex;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue