public void open() { if (con) { state = "open"; try { byte[] msg = client.Receive(ref remoteEndPoint); msgReceiptEventArg e = new msgReceiptEventArg(); e.data = msg; e.requestIP = remoteEndPoint.Address.ToString(); e.requestPoint = remoteEndPoint.Port.ToString(); if (msgReceiptEvent != null) { msgReceiptEvent(this, e); } } catch { close(); } open(); } }
private void listen_msgReceiptEvent(object sender, msgReceiptEventArg e) { this.Invoke(new ThreadUIHandle(ThreadUIHandleMethod), new object[] { e.data }); }