Example #1
0
 public CNetwork()
 {
     this.m_oSocket        = null;
     this.m_oProcess       = null;
     this.m_oLogger        = null;
     this.m_dwSendBuffSize = 0u;
     this.m_dwRecvBuffSize = 0u;
 }
Example #2
0
 /// <summary>
 /// 初始化Network
 /// </summary>
 /// <param name="oProc"></param>
 /// <param name="oBreaker"></param>
 /// <param name="dwSendBuffSize">发送缓存数组</param>
 /// <param name="dwRecvBuffSize">接收缓存数组</param>
 /// <param name="strLogDir">network.log的目录</param>
 /// <param name="bLogEnabled">是否启动log</param>
 /// <returns></returns>
 public bool Init(INetProcess oProc, IPacketBreaker oBreaker, uint dwSendBuffSize, uint dwRecvBuffSize, string strLogDir, bool bLogEnabled)
 {
     this.m_oProcess       = oProc;
     this.m_oBreaker       = oBreaker;
     this.m_dwSendBuffSize = dwSendBuffSize;
     this.m_dwRecvBuffSize = dwRecvBuffSize;
     this.m_PieceBufferIO  = new PieceBufferIO();
     this.m_oDataQueue     = new Queue();
     this.m_oLogger        = new CNetLogger(strLogDir, bLogEnabled);
     this.m_oLogger.LogInfo("-----------------------------");
     this.m_oLogger.LogInfo("Init network succ");
     return(true);
 }