private void SendAllCallBack(bool async, SendAllContext context)
 {
     context.SocketArgs.SetBuffer(null, 0, 0);
     context.SocketArgs.BufferList = null;
     context.SocketArgs.UserToken  = null;
     if (async)
     {
         context.EventArgs.Completed(context.EventArgs);
     }
 }
        public AsyncSocketWrapper()
        {
            _notIoArgs            = new SocketAsyncEventArgs();
            _notIoArgs.Completed += NotSendCallBack;

            _receiveArgs            = new SocketAsyncEventArgs();
            _receiveArgs.Completed += NotSendCallBack;

            _sendArgs            = new SocketAsyncEventArgs();
            _sendArgs.Completed += SendCallBack;

            _sendAllContext = new SendAllContext();
            _sendAllContext.SendCallBack = SendAllCallBack;
            _sendAllContext.SocketArgs   = _sendArgs;
        }
        public AsyncSocketWrapper()
        {
            _notIoArgs = new SocketAsyncEventArgs();
            _notIoArgs.Completed += NotSendCallBack;

            _receiveArgs = new SocketAsyncEventArgs();
            _receiveArgs.Completed += NotSendCallBack;

            _sendArgs = new SocketAsyncEventArgs();
            _sendArgs.Completed += SendCallBack;

            _sendAllContext = new SendAllContext();
            _sendAllContext.SendCallBack = SendAllCallBack;
            _sendAllContext.SocketArgs = _sendArgs;
        }
 private void SendAllCallBack(SendAllContext context)
 {
     SendAllCallBack(true, context);
 }
 private void SendAllCallBack(bool async, SendAllContext context)
 {
     context.SocketArgs.SetBuffer(null,0,0);
     context.SocketArgs.BufferList = null;
     context.SocketArgs.UserToken = null;
     if (async) context.EventArgs.Completed(context.EventArgs);
 }
 private void SendAllCallBack(SendAllContext context)
 {
     SendAllCallBack(true, context);
 }