コード例 #1
0
 public void SendData(string host, int port, byte[] sendBytes)
 {
     lock (this)
     {
         UDPClient client3 = new UDPClient(host, port);
         client3.Connect();
         client3.SendData(sendBytes);
         client3.DisConnect();
     }
 }
コード例 #2
0
        public void SendData(string data)
        {
            lock (this)
            {
                byte[] sendBytes = Encoding.ASCII.GetBytes(data);

                client.Connect();
                client.SendData(sendBytes);
                client.DisConnect();
            }
        }
コード例 #3
0
        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();
            }
        }