public SaeaConnectState(ILog log, int id, TimeOut timeOut, SaeaConnectStatePool pool) { this.log = log; this.id = id; this.timeOut = timeOut; _m_ConnectStatePool = pool; }
public bool Init() { try { //初始化Sokect listenSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); //初始化IP地址 ipAddress = IPAddress.Parse(ipString); ipEndPoint = new IPEndPoint(ipAddress, ipPort); //初始化缓存池 connectStatePool = new SaeaConnectStatePool(log, timeOut); connectStatePool.Init(maxConnectNum); return(true); } catch (Exception e) { string errorInfor = string.Format("Server init error: {0}", e.Message); log.ErrorLog(errorInfor); return(false); } }