public void Start() { //启动服务器 localServer.Port = 5011; localServer.Start(); clientMan = localServer.ClientMan; //clientMan.Start(); }
void InitClientListConfig() { //初始化客户端列表 XmlConfig config = new XmlConfig("config.xml"); List<DeviceItem> devList = config.ReadDeviceList(); clientMan = new ClientMan(); foreach (DeviceItem item in devList) { clientMan.Add(item.Name, item.IP, item.Port); } clientMan.OnSocketReceived += new SocketReceivedHandler(clientMan_OnSocketReceived); clientMan.OnStateChanged += new EventHandler<StateChangedEventArgs>(clientMan_OnStateChanged); clientMan.OnDataChanged += new EventHandler<DataHandlerEventArgs>(clientMan_OnDataChanged); }