Example #1
0
        private SendBufferPacket m_sendBufferPacket;      //发送记录包

        /// <summary>
        /// 初始化发送缓存
        /// </summary>
        /// <param name="bufferSize">int</param>
        public AsyncSendBufferManager(int bufferSize)
        {
            m_dynamicBufferManager    = new DynamicBufferManager(bufferSize);
            m_sendBufferList          = new List <SendBufferPacket>();
            m_sendBufferPacket.Offset = 0;
            m_sendBufferPacket.Count  = 0;
        }
 /// <summary>
 /// 创建Sockets对象
 /// </summary>
 /// <param name="ip">Ip地址</param>
 /// <param name="client">TcpClient</param>
 /// <param name="ns">承载客户端Socket的网络流</param>
 public SocketUserToken(string ServerIp, int ServerPort, TcpClient client, NetworkStream nStream)
 {
     m_ServerIp      = ServerIp;
     m_ServerPort    = ServerPort;
     m_client        = client;
     m_nStream       = nStream;
     m_receiveBuffer = new DynamicBufferManager(BuffSize);
     m_sendBuffer    = new AsyncSendBufferManager(BuffSize);
 }