private void InitNMonMonitorClient() { try { if (mNetMonitorClient != null) { mNetMonitorClient.Stop(); mNetMonitorClient = null; } //string strAddress = App.Session.AppServerInfo.Address; //int intPort = App.Session.AppServerInfo.SupportHttps // ? App.Session.AppServerInfo.Port - 5 // : App.Session.AppServerInfo.Port - 4; string strAddress = "192.168.5.31"; int intPort = 8081 - 4; mNetMonitorClient = new MonitorClient(); mNetMonitorClient.Debug += (mode, msg) => AppendMessage(string.Format("MonitorClient\t{0}", msg)); mNetMonitorClient.ReturnMessageReceived += NMonMonitorClient_ReturnMessageReceived; mNetMonitorClient.NotifyMessageReceived += NMonMonitorClient_NotifyMessageReceived; mNetMonitorClient.Connect(strAddress, intPort); } catch (Exception ex) { AppendMessage(ex.Message); } }