/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package udp;

import java.net.*;

public class Main
{
  public static void klient_udp()
  {
  try {
      String host = "127.0.0.1";
      int port = 6767;
      byte[] message = " :P".getBytes();

      // Get the internet address of the specified host
      InetAddress address = InetAddress.getByName(host);

      // Initialize a datagram packet with data and address
      DatagramPacket packet = new DatagramPacket(message, message.length,address, port);

      // Create a datagram socket, send the packet through it, close it.
      DatagramSocket dsocket = new DatagramSocket();
      dsocket.send(packet);
      dsocket.close();
     } catch (Exception e)
        {
          System.err.println(e);
        }
  }
  
  public static void main(String args[])
  {
    klient_udp();
  }
}
