package vs;

import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetAddress;

/**
 * Client for echo var.sockets.udp.game.ReactionGameServer service. Sendet leerees Paket an HOST.
 *
 * @author Sandro Leuchter
 *
 */
public class ReactionGameClient {
  /**
   * host on which server is running (IP-address or hostname)
   */
  private static final String HOST = "localhost";
  /**
   * port on which service is running on host
   */
  private static final int PORT = 4714;
  /**
   * maximum size of payload in datagram
   */
  private static final int BUFSIZE = 0;

  /**
   * main method: entrypoint to run
   *
   * @param args
   *          ignored
   */
  public static void main(String[] args) {
    try (DatagramSocket socket = new DatagramSocket()) {
      InetAddress iaddr = InetAddress.getByName(HOST);
      DatagramPacket packetOut = new DatagramPacket(new byte[BUFSIZE], BUFSIZE, iaddr, PORT);
      socket.send(packetOut);
    } catch (Exception e) {
      System.err.println(e);
    }
  }
}
