/** * Methods */ /// <summary> /// Initializes a new instance of the <see cref="CommManager"/> class. /// </summary> public CommManager() { instance = this; sessionThreads = new List <Thread>(16); sessions = new List <Session>(16); commMgrThread = new Thread(new ThreadStart(CommManagerThread)); commMgrThread.Name = "CommManagerThread"; Messages.Trace("created comm manager thread [" + commMgrThread.Name + "]"); IPAddress allAddr = IPAddress.Parse("0.0.0.0"); socketServer = new TcpListener(allAddr, port); }
/** * Methods */ /// <summary> /// Initializes a new instance of the <see cref="Session"/> class. /// </summary> /// <param name="commMgr"></param> /// <param name="client"></param> public Session(CommManager commMgr, TcpClient client) { this.commMgr = commMgr; this.client = client; this.client.ReceiveBufferSize = TEMP_BUFFER_SIZE; this.tempBuffer = new byte[TEMP_BUFFER_SIZE]; this.macAddress = new byte[6]; this.isShutdown = false; this.streamExceptionCount = 0; this.waitMRE = new ManualResetEventSlim(false); }