static void Proc() { IList <int> list = new List <int>() { 7777 }; // null;// new SCM.RF.Server.BizProcess.AuthCenter.UserBP().GetList(); foreach (int port in list) { if (!ht.ContainsKey(port)) { ht.Add(port, null); SocketListenerV2 _SocketListenerV2 = new SocketListenerV2(SystemInstance.SystemEntityInstance.ServerIP, port); Console.WriteLine("端口:" + port + " 开始监听。"); _SocketListenerV2.Start(); } } }
private void btnStart_Click(object sender, System.EventArgs e) { _SocketListenerV2 = new SocketListenerV2(SystemInstance.SystemEntityInstance.ServerIP, SystemInstance.SystemEntityInstance.Port); _SocketListenerV2.Start(); }