From da5850ec3a81f358b1f1bfa350380759babfd57c Mon Sep 17 00:00:00 2001 From: brutzman <brutzman@nps.edu> Date: Wed, 14 Feb 2018 14:30:31 -0800 Subject: [PATCH] class changes --- .../UdpExample1/UdpSender/src/udpsender/UdpSender.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/projects/UdpExample1/UdpSender/src/udpsender/UdpSender.java b/projects/UdpExample1/UdpSender/src/udpsender/UdpSender.java index 3337007c30..f9798e0281 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 ); -- GitLab