diff --git a/examples/src/UdpMulticastHttpExamples/UdpSender.java b/examples/src/UdpMulticastHttpExamples/UdpSender.java index 18afda921bf49c9001de1eb842a0fc6e3d09eb4d..83c0f6e6f12ff5ba496d838fb8d1e80a2721d0fe 100644 --- a/examples/src/UdpMulticastHttpExamples/UdpSender.java +++ b/examples/src/UdpMulticastHttpExamples/UdpSender.java @@ -16,8 +16,8 @@ import java.net.*; */ public class UdpSender { - - public static final int SENDING_PORT = 1414; + public static final String MY_NAME = "(default name)"; + public static final int SENDING_PORT = 1414; public static final int RECEIVING_PORT = 1415; public static final String DESTINATION_HOST = "localhost"; @@ -45,6 +45,8 @@ public class UdpSender // ID of the host we are sending to InetAddress destinationAddress = InetAddress.getByName(DESTINATION_HOST); + // ID of the host we are sending from + InetAddress sourceAddress = InetAddress.getByName("localhost"); // possibly identical if source not modified DatagramPacket packet = new DatagramPacket(buffer, buffer.length, destinationAddress, RECEIVING_PORT ); @@ -58,7 +60,7 @@ public class UdpSender { udpSocket.send(packet); Thread.sleep(1000); // Send 100, one per second - System.out.println("Bert Sent packet " + index + " of 100"); + System.out.println(MY_NAME + " " + sourceAddress + " sent packet " + index + " of 100"); } System.out.println("UdpSender complete."); }