Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
NetworkedGraphicsMV3500
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Savage
NetworkedGraphicsMV3500
Commits
cc523d3b
Commit
cc523d3b
authored
5 years ago
by
tobia
Browse files
Options
Downloads
Patches
Plain Diff
No commit message
No commit message
parent
ac3d4d0f
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
assignments/src/MV3500Cohort2019JulySeptember/homework4/Brennenstuhl/Version2/AllPduSender.java
+2
-12
2 additions, 12 deletions
...ptember/homework4/Brennenstuhl/Version2/AllPduSender.java
with
2 additions
and
12 deletions
assignments/src/MV3500Cohort2019JulySeptember/homework4/Brennenstuhl/Version2/AllPduSender.java
+
2
−
12
View file @
cc523d3b
...
...
@@ -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
+
"\""
);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment