BitSharp.Network.Workers.ListenWorker.WorkAction C# (CSharp) Method

WorkAction() protected method

protected WorkAction ( ) : System.Threading.Tasks.Task
return System.Threading.Tasks.Task
        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.");
            }
        }