예제 #1
0
파일: NetState.cs 프로젝트: RainsSoft/DogSE
        /// <summary>
        /// 发送数据(在多线程中主要实现了顺序的发送)
        /// </summary>
        /// <param name="packet">需要发送的数据包</param>
        public void Send(Packet packet)
        {
            if (Running == false)
                return;

            if (IsBatchNow)
                m_Socket.SendPackage(packet.WriterStream.GetBuffer(), false);
            else
                m_Socket.SendPackage(packet.WriterStream.GetBuffer());
            packet.Release();
        }
예제 #2
0
파일: NetState.cs 프로젝트: Jimlan/DogSE
        /// <summary>
        /// 发送数据(在多线程中主要实现了顺序的发送)
        /// </summary>
        /// <param name="packet">需要发送的数据包</param>
        public void Send(Packet packet)
        {
            if (Running == false)
                return;

            // 防止发送的顺序出错
            m_Socket.SendPackage(packet.WriterStream.GetBuffer());
            packet.Release();
        }