static void OnSend(IAsyncResult result)
            {
                if (result.CompletedSynchronously)
                {
                    return;
                }

                SocketSendAsyncResult thisPtr             = (SocketSendAsyncResult)result.AsyncState;
                Exception             completionException = null;
                bool shouldComplete = false;

                try
                {
                    if (thisPtr.CompleteSend(result))
                    {
                        shouldComplete = true;
                    }
                    else
                    {
                        thisPtr.StartSending();
                    }
                }
                catch (Exception e)
                {
                    completionException = e;
                }

                if (shouldComplete)
                {
                    thisPtr.Complete(false, completionException);
                }
            }
Exemple #2
0
            static void OnSend(IAsyncResult result)
            {
                if (result.CompletedSynchronously)
                {
                    return;
                }

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

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

                thisPtr.Complete(false, completionException);
            }
 void EndSocketSend(IAsyncResult result)
 {
     SocketSendAsyncResult.End(result);
 }
 void EndWriteData(IAsyncResult result)
 {
     SocketSendAsyncResult.End(result);
 }