diff --git a/projects/UdpExample1/UdpSender/src/udpsender/UdpSender.java b/projects/UdpExample1/UdpSender/src/udpsender/UdpSender.java index 3337007c300671d8900fb27ee2c79bb0342c5873..f9798e028129d01519cb596308d3d4bef9fa6a99 100644 --- a/projects/UdpExample1/UdpSender/src/udpsender/UdpSender.java +++ b/projects/UdpExample1/UdpSender/src/udpsender/UdpSender.java @@ -17,7 +17,7 @@ public class UdpSender public static final int SENDING_PORT = 1414; public static final int RECEIVING_PORT = 1415; - public static final String DESINATION_HOST = "localhost"; + public static final String DESTINATION_HOST = "localhost"; public static void main(String[] args) { @@ -32,14 +32,15 @@ public class UdpSender ByteArrayOutputStream baos = new ByteArrayOutputStream(); DataOutputStream dos = new DataOutputStream(baos); - dos.writeFloat(17.0f); // alternatives: writeFloat(17.0f); writeInt(17); + // alternatives: writeFloat(17.0f); writeInt(17); writeUTF("\"hello MV3500 no really\""); + dos.writeFloat(17.0f); dos.writeFloat(23.0f); byte[] buffer = baos.toByteArray(); // Put together a packet to send // ID of the host we are sending to - InetAddress destinationAddress = InetAddress.getByName(DESINATION_HOST); + InetAddress destinationAddress = InetAddress.getByName(DESTINATION_HOST); DatagramPacket packet = new DatagramPacket(buffer, buffer.length, destinationAddress, RECEIVING_PORT );