private void OnMoteMessageArrived(object sender, EventArgMessage msg) { if (!tcpClient.Connected) { return; } try { this.Send(msg.getMsg()); } catch (Exception e) { RaiseEventClientDC(e.Message); this.tcpClient.Close(); } }
private void OnTCPMessageArrived(object sender, EventArgMessage msg) { Thread moteMessenger = new Thread(new ParameterizedThreadStart(SendMessageToMote)); moteMessenger.Start(msg.getMsg()); }