InetAddress inetAddress = InetAddress.getByName(host);
InetSocketAddress address = new InetSocketAddress(inetAddress, port);
MulticastSocket multicast = new MulticastSocket(port);
multicast.joinGroup(inetAddress);
final MulticastSocket s = multicast;
if (options.has("reuse-address")) s.setReuseAddress(options.get("reuse-address", false));
if (options.has("broadcast")) s.setBroadcast(options.get("broadcast", false));
if (options.has("loopback-mode")) s.setLoopbackMode(options.get("loopback-mode", false));
if (options.has("send-buffer-size")) s.setSendBufferSize(options.get("send-buffer-size", 0));
if (options.has("receive-buffer-size")) s.setReceiveBufferSize(options.get("receive-buffer-size", 0));
if (options.has("so-timeout")) s.setSoTimeout(options.get("so-timeout", 0));
if (options.has("time-to-live")) s.setTimeToLive(options.get("time-to-live", 0));
if (options.has("traffic-class")) s.setTrafficClass(options.get("traffic-class", 0));
System.out.println("Connected");
print("host", host);
print("port", port);
System.out.println();
System.out.println("Socket");
print("broadcast", s.getBroadcast());
print("loopback-mode", s.getLoopbackMode());
print("receive-buffer-size", s.getReceiveBufferSize());
print("reuse-address", s.getReuseAddress());
print("send-buffer-size", s.getSendBufferSize());
print("so-timeout", s.getSoTimeout());
print("time-to-live", s.getTimeToLive());
print("traffic-class", s.getTrafficClass());
System.out.println();
if (options.has("send")) {
String send = options.get("send", "");
long rate = options.get("rate", 1000);