示例#1
0
        public void PushRequest(byte[] wrapData)
        {
            lock (mLock)
            {
                if (mNetState != ENetState.ES_Connected)
                {
                    return;
                }

                if (wrapData != null)
                {
                    CSocket.Request req = new CSocket.Request();
                    req.Data       = new List <byte>();
                    req.SendedByte = 0;
                    for (int i = 0; i < wrapData.Length; i++)
                    {
                        req.Data.Add(wrapData[i]);
                    }

                    mRequestList.AddLast(req);

                    if (mRequestList.Count == 1)
                    {
                        this.Send(wrapData);
                    }
                }
            }
        }
示例#2
0
		public void PushRequest(byte[] wrapData)
		{
			lock(mLock)
			{
				if (mNetState != ENetState.ES_Connected)
					return;

				if (wrapData != null)
				{
					CSocket.Request req = new CSocket.Request();
					req.Data = new List<byte>();
					req.SendedByte = 0;
					for (int i=0; i<wrapData.Length; i++)
					{
						req.Data.Add(wrapData[i]);
					}
					
					mRequestList.AddLast(req);
					
					if (mRequestList.Count == 1)
						this.Send(wrapData);
				}
			}
		}