public void SendData(string host, int port, byte[] sendBytes) { lock (this) { UDPClient client3 = new UDPClient(host, port); client3.Connect(); client3.SendData(sendBytes); client3.DisConnect(); } }
public void SendData(string data) { lock (this) { byte[] sendBytes = Encoding.ASCII.GetBytes(data); client.Connect(); client.SendData(sendBytes); client.DisConnect(); } }
public void SendData(string host, int port, string data) { lock (this) { UDPClient client2 = new UDPClient(host, port); byte[] sendBytes = Encoding.ASCII.GetBytes(data); client2.Connect(); client2.SendData(sendBytes); client2.DisConnect(); } }