Esempio n. 1
0
        /// <summary>
        /// 非同步送出
        /// </summary>
        /// <param name="sendObj"></param>
        public virtual void AsyncSend(ISateObject sendObj)
        {
            try
            {
                if (null == sendObj.Callback)
                {
                    throw new NullReferenceException("[Parameter] Callback Property can't null ");
                }
                if (null == sendObj.Client)
                {
                    sendObj.Client = this._client;
                }

                _client.BeginSend(sendObj.Buffer, 0, sendObj.Buffer.Length, SocketFlags.None, sendObj.Callback, sendObj.Client);
            }
            catch
            {
                throw;
            }
        }
Esempio n. 2
0
        /// <summary>
        /// 非同步接收
        /// </summary>
        /// <param name="SendObj"></param>
        public virtual void AsyncReceive(ISateObject receiveObj)
        {
            try
            {
                if (null == receiveObj.Callback)
                {
                    throw new NullReferenceException("[Parameter] Callback Property can't null");
                }
                if (null == receiveObj.Client)
                {
                    receiveObj.Client = this._client;
                }

                _client.BeginReceive(receiveObj.Buffer, 0, receiveObj.Buffer.Length, SocketFlags.None, receiveObj.Callback, receiveObj);
            }
            catch
            {
                throw;
            }
        }
Esempio n. 3
0
        /// <summary>
        /// 非同步接收
        /// </summary>
        /// <param name="SendObj"></param>
        public virtual void AsyncReceive(ISateObject receiveObj)
        {
            try
            {
                if (null == receiveObj.Callback)
                {
                    throw new NullReferenceException("[Parameter] Callback Property can't null");
                }
                if (null == receiveObj.Client)
                    receiveObj.Client = this._client;

                _client.BeginReceive(receiveObj.Buffer, 0, receiveObj.Buffer.Length, SocketFlags.None, receiveObj.Callback, receiveObj);
            }
            catch
            {
                throw ;
            }
        }
Esempio n. 4
0
        /// <summary>
        /// 非同步送出
        /// </summary>
        /// <param name="sendObj"></param>
        public virtual void AsyncSend(ISateObject sendObj)
        {
            try
            {

                if (null == sendObj.Callback)
                {
                    throw new NullReferenceException("[Parameter] Callback Property can't null ");
                }
                if (null == sendObj.Client)
                    sendObj.Client = this._client;

                _client.BeginSend(sendObj.Buffer, 0, sendObj.Buffer.Length, SocketFlags.None, sendObj.Callback, sendObj.Client);
            }
            catch
            {
                throw;
            }
        }