public void EndCloseInput(IAsyncResult result)
 {
     if (result is CloseCommunicationAsyncResult)
     {
         CloseCommunicationAsyncResult.End(result);
         if (Interlocked.Decrement(ref _activityWaiterCount) == 0)
         {
             _activityWaiter.Dispose();
             _activityWaiter = null;
         }
     }
     else
     {
         CompletedAsyncResult.End(result);
     }
 }