// Path: measures/src/main/java/io/apisense/network/MeasurementConfigException.java
// public class MeasurementConfigException extends Exception {
//   public MeasurementConfigException(String reason) {
//     super(reason);
//   }
// 
//   public MeasurementConfigException(Exception cause) {
//     super(cause);
//   }
// }


import java.net.InetAddress;
import java.net.UnknownHostException;
import io.apisense.network.MeasurementConfigException;
package io.apisense.network.udp;



/**
 * Configuration class for both upload an download UDPBurstTask
 */

public class UDPBurstConfig {
  /**
   * Min packet size = (int type) + (int burstCount) + (int packetNum) + (int intervalNum) + (long
   * timestamp) + (int packetSize) + (int seq) + (int udpInterval) = 36
   */
  private static final int MIN_PACKETSIZE = 36;

  /**
   * Leave enough margin for min MTU in the link and IP options.
   */
  private static final int MAX_PACKETSIZE = 500;

  /**
   * Size of the packets in bytes
   */
  private int packetSizeByte = 100;

  /**
   * Number of packet to send by burst.
   */
  private int udpBurstCount = 16;

  /**
   * Interval between burst (µs).
   *
   * This value will be rounded in {@link UDPPacket#UDPPacket(int, UDPBurstConfig)}.
   */
  private int udpInterval = 500;

  /**
   * IP address of the remote server used for the test
   */
  private InetAddress targetIp;

  /**
   * URL of the remote server used for the test
   */
  private String url;

// Path: measures/src/main/java/io/apisense/network/MeasurementConfigException.java
// public class MeasurementConfigException extends Exception {
//   public MeasurementConfigException(String reason) {
//     super(reason);
//   }
// 
//   public MeasurementConfigException(Exception cause) {
//     super(cause);
//   }
// }


// Path: measures/src/main/java/io/apisense/network/udp/UDPBurstConfig.java
import java.net.InetAddress;
import java.net.UnknownHostException;
import io.apisense.network.MeasurementConfigException;

package io.apisense.network.udp;



/**
 * Configuration class for both upload an download UDPBurstTask
 */

public class UDPBurstConfig {
  /**
   * Min packet size = (int type) + (int burstCount) + (int packetNum) + (int intervalNum) + (long
   * timestamp) + (int packetSize) + (int seq) + (int udpInterval) = 36
   */
  private static final int MIN_PACKETSIZE = 36;

  /**
   * Leave enough margin for min MTU in the link and IP options.
   */
  private static final int MAX_PACKETSIZE = 500;

  /**
   * Size of the packets in bytes
   */
  private int packetSizeByte = 100;

  /**
   * Number of packet to send by burst.
   */
  private int udpBurstCount = 16;

  /**
   * Interval between burst (µs).
   *
   * This value will be rounded in {@link UDPPacket#UDPPacket(int, UDPBurstConfig)}.
   */
  private int udpInterval = 500;

  /**
   * IP address of the remote server used for the test
   */
  private InetAddress targetIp;

  /**
   * URL of the remote server used for the test
   */
  private String url;

  public UDPBurstConfig(String url, int packetSizeByte) throws MeasurementConfigException {