Ejemplo n.º 1
0
        private void OnStreamClose(Task copyAsyncTask)
        {
            _memory.Return(_block);

            if (copyAsyncTask.IsFaulted)
            {
                SocketInput.AbortAwaiting();
                Service.Logger.Log(copyAsyncTask.Exception);
            }
            else if (copyAsyncTask.IsCanceled)
            {
                SocketInput.AbortAwaiting();
                Service.Logger.Log(LogLevel.Error, "FilteredStreamAdapter.CopyToAsync canceled.");
            }
            else if (_aborted)
            {
                SocketInput.AbortAwaiting();
            }

            try
            {
                SocketInput.IncomingFin();
            }
            catch (Exception ex)
            {
                Service.Logger.Log(ex);
            }
        }
Ejemplo n.º 2
0
        private void OnStreamClose(Task copyAsyncTask)
        {
            _memory.Return(_block);

            if (copyAsyncTask.IsFaulted)
            {
                SocketInput.AbortAwaiting();
                _log.LogError(0, copyAsyncTask.Exception, "FilteredStreamAdapter.CopyToAsync");
            }
            else if (copyAsyncTask.IsCanceled)
            {
                SocketInput.AbortAwaiting();
                _log.LogError("FilteredStreamAdapter.CopyToAsync canceled.");
            }
            else if (_aborted)
            {
                SocketInput.AbortAwaiting();
            }

            try
            {
                _socketInputStream.Dispose();
            }
            catch (Exception ex)
            {
                _log.LogError(0, ex, "FilteredStreamAdapter.OnStreamClose");
            }
        }