Refactor logging. Remove TCP adapter from HTTP host if disabled.

This commit is contained in:
Christian
2018-05-13 20:18:08 +02:00
parent 8df8cb1eb6
commit dc7b9414d9
13 changed files with 41 additions and 38 deletions
@@ -45,11 +45,8 @@ namespace MQTTnet.Implementations
_defaultEndpointSocket.Bind(new IPEndPoint(options.DefaultEndpointOptions.BoundIPAddress, options.GetDefaultEndpointPort()));
_defaultEndpointSocket.Listen(options.ConnectionBacklog);
Task.Factory.StartNew(
() => AcceptDefaultEndpointConnectionsAsync(_cancellationTokenSource.Token),
_cancellationTokenSource.Token,
TaskCreationOptions.LongRunning,
TaskScheduler.Current);
Task.Run(() => AcceptDefaultEndpointConnectionsAsync(_cancellationTokenSource.Token),
_cancellationTokenSource.Token);
}
if (options.TlsEndpointOptions.IsEnabled)
@@ -69,11 +66,9 @@ namespace MQTTnet.Implementations
_tlsEndpointSocket.Bind(new IPEndPoint(options.TlsEndpointOptions.BoundIPAddress, options.GetTlsEndpointPort()));
_tlsEndpointSocket.Listen(options.ConnectionBacklog);
Task.Factory.StartNew(
() => AcceptTlsEndpointConnectionsAsync(_cancellationTokenSource.Token),
_cancellationTokenSource.Token,
TaskCreationOptions.LongRunning,
TaskScheduler.Current);
Task.Run(
() => AcceptTlsEndpointConnectionsAsync(_cancellationTokenSource.Token),
_cancellationTokenSource.Token);
}
return Task.FromResult(0);