protected override async Task WorkAction()
{
try
{
var newSocket = await Task.Factory.FromAsync<Socket>(this.listenSocket.BeginAccept(null, null), this.listenSocket.EndAccept);
await this.peerWorker.AddIncomingPeer(newSocket);
}
catch (Exception ex) when (!(ex is OperationCanceledException))
{
logger.Warn(ex, "Failed incoming connection.");
}
}