Example #1
0
            static void OnWrite(IAsyncResult result)
            {
                if (result.CompletedSynchronously)
                {
                    return;
                }

                SendAsyncResult thisPtr             = (SendAsyncResult)result.AsyncState;
                Exception       completionException = null;

                try
                {
                    thisPtr.CompleteWrite(result);
                }
                catch (Exception e)
                {
                    completionException = e;
                }

                thisPtr.Complete(false, completionException);
            }
Example #2
0
            static void OnWriteComplete(object asyncState)
            {
                SendAsyncResult thisPtr             = (SendAsyncResult)asyncState;
                Exception       completionException = null;

                try
                {
                    thisPtr.channel.FinishWritingMessage();
                }
#pragma warning suppress 56500 // [....], transferring exception to another thread
                catch (Exception e)
                {
                    if (Fx.IsFatal(e))
                    {
                        throw;
                    }

                    completionException = e;
                }

                thisPtr.Cleanup(completionException == null, true);
                thisPtr.Complete(false, completionException);
            }