Beispiel #1
0
        /// <summary>
        /// 接收
        /// </summary>
        public void Receive()
        {
            try
            {
                CSocketAsyncEventArgsRecv e = new CSocketAsyncEventArgsRecv();
                e.Completed += new EventHandler <SocketAsyncEventArgs>(RecvComplete);
                e.SetBuffer(this.m_cReceiveBuffer.m_lstBuffer, this.m_cReceiveBuffer.WriteIndex, this.m_cReceiveBuffer.GetLength() - this.m_cReceiveBuffer.WriteIndex);

                bool done = this.m_cSocket.ReceiveAsync(e);

                if (!done)
                {
                    ReceiveProcess(e);
                }
            }
            catch (Exception e)
            {
                //
            }
        }
 /// <summary>
 /// 创建接收异步参数
 /// </summary>
 /// <returns></returns>
 public CSocketAsyncEventArgsRecv CreateRecv()
 {
     CSocketAsyncEventArgsRecv e = new CSocketAsyncEventArgsRecv();
     return e;
 }
Beispiel #3
0
        /// <summary>
        /// 接收
        /// </summary>
        public void Receive()
        {
            try
            {
                CSocketAsyncEventArgsRecv e = new CSocketAsyncEventArgsRecv();
                e.Completed += new EventHandler<SocketAsyncEventArgs>(RecvComplete);
                e.SetBuffer(this.m_cReceiveBuffer.m_lstBuffer, this.m_cReceiveBuffer.WriteIndex, this.m_cReceiveBuffer.GetLength() - this.m_cReceiveBuffer.WriteIndex);

                bool done = this.m_cSocket.ReceiveAsync(e);

                if (!done)
                {
                    ReceiveProcess(e);
                }
            }
            catch (Exception e)
            {
                //
            }
        }
Beispiel #4
0
        /// <summary>
        /// 创建接收异步参数
        /// </summary>
        /// <returns></returns>
        public CSocketAsyncEventArgsRecv CreateRecv()
        {
            CSocketAsyncEventArgsRecv e = new CSocketAsyncEventArgsRecv();

            return(e);
        }