diff --git a/assignments/src/MV3500Cohort2019JulySeptember/homework4/Brennenstuhl/Version2/AllPduSender.java b/assignments/src/MV3500Cohort2019JulySeptember/homework4/Brennenstuhl/Version2/AllPduSender.java index f2a6244cd8f4ada383a4f2047249fb36b4aa645a..a1607920c29d1843ec83854ee99368a7e301e8e9 100755 --- a/assignments/src/MV3500Cohort2019JulySeptember/homework4/Brennenstuhl/Version2/AllPduSender.java +++ b/assignments/src/MV3500Cohort2019JulySeptember/homework4/Brennenstuhl/Version2/AllPduSender.java @@ -57,10 +57,6 @@ public class AllPduSender Pdu aPdu = null; // edu.​nps.​moves7.​dis.PDU superclass for all PDUs, in preparation for custom assignment - - - - //*************************************************************************** CommentPdu newCommentPdu = new CommentPdu(); ArrayList<VariableDatum> payloadList = new ArrayList<VariableDatum>(); @@ -68,17 +64,11 @@ public class AllPduSender ArrayList<String> commentsList = new ArrayList<>(); commentsList.add("Hello CommentPDU"); commentsList.add("Chuck Norris is comming to town from IP-Adress " + DEFAULT_MULTICAST_ADDRESS + " with Port " + DEFAULT_MULTICAST_PORT); - - if (!commentsList.isEmpty()) - System.out.println("Preparing CommentPDU:"); - + for (String comment : commentsList) { VariableDatum newVariableDatum = new VariableDatum(); - newVariableDatum.setVariableDatumValue (comment.getBytes()); // conversion - //newVariableDatum.setVariableDatumLength(comment.getBytes().length * 8); // bits, not bytes, see spec and javadoc - // alternatively, you do not need to set this and the marshaller will figure it out from the byte array - // (see javadoc for VariableDatum.setVariableDatumLength()) + newVariableDatum.setVariableDatumValue (comment.getBytes()); payloadList.add(newVariableDatum); System.out.println(" \"" + comment + "\""); }