package com.example.myfirstapp;

import java.net.*;
import java.io.*;


public class UdpClient implements Runnable {
	static String serverAddressStr = "224.0.0.1";
	static int BROADCAST_PORT = 9898;
	static int TTLTime = 255;
	TcpSender ts;

	@Override
	public void run() {
		//ts.addReceiver(ip);
		InetAddress serverAddress = InetAddress.getByName(serverAddressStr);
		int port = BROADCAST_PORT;
		MulticastSocket ms = new MulticastSocket();
		ms.setTimeToLive(TTLTime);
		byte[] message = new byte[100];
		DatagramPacket dataPacket = new DatagramPacket(message, message.length,
				serverAddress, port);
		ms.send(dataPacket);
		ms.close();

	}

	public UdpClient(TcpSender ts) {
		this.ts = ts;
	}
}

@@ -335,16 +335,51 @@
 ddress =
+ null;%0D%0A%09%09try %7B%0D%0A%09%09%09serverAddress =
  InetAdd
@@ -413,16 +413,125 @@
 sStr);%0D%0A
+%09%09%7D catch (UnknownHostException e1) %7B%0D%0A%09%09%09// TODO Auto-generated catch block%0D%0A%09%09%09e1.printStackTrace();%0D%0A%09%09%7D%0D%0A
 %09%09int po
@@ -574,16 +574,40 @@
 ket ms =
+ null;%0D%0A%09%09try %7B%0D%0A%09%09%09ms =
  new Mul
@@ -629,34 +629,240 @@
 %0D%0A%09%09
-ms.setTimeToLive(TTLTime);
+%7D catch (IOException e) %7B%0D%0A%09%09%09// TODO Auto-generated catch block%0D%0A%09%09%09e.printStackTrace();%0D%0A%09%09%7D%0D%0A%09%09try %7B%0D%0A%09%09%09ms.setTimeToLive(TTLTime);%0D%0A%09%09%7D catch (IOException e) %7B%0D%0A%09%09%09// TODO Auto-generated catch block%0D%0A%09%09%09e.printStackTrace();%0D%0A%09%09%7D
 %0D%0A%09%09
@@ -992,24 +992,34 @@
 ss, port);%0D%0A
+%09%09try %7B%0D%0A%09
 %09%09ms.send(da
@@ -1030,16 +1030,114 @@
 cket);%0D%0A
+%09%09%7D catch (IOException e) %7B%0D%0A%09%09%09// TODO Auto-generated catch block%0D%0A%09%09%09e.printStackTrace();%0D%0A%09%09%7D%0D%0A
 %09%09ms.clo

remove file