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
977aeda7
Commit
977aeda7
authored
3 years ago
by
Brutzman, Don
Browse files
Options
Downloads
Patches
Plain Diff
refactored DisTime utilities package in open-dis7-java library
parent
53be76d0
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
examples/DisShooting/src/DisShooting/NetworkComms.java
+3
-7
3 additions, 7 deletions
examples/DisShooting/src/DisShooting/NetworkComms.java
with
3 additions
and
7 deletions
examples/DisShooting/src/DisShooting/NetworkComms.java
+
3
−
7
View file @
977aeda7
package
DisShooting
;
import
edu.nps.moves.dis7.pdus.DisTime
;
import
edu.nps.moves.dis7.pdus.Pdu
;
import
edu.nps.moves.dis7.utilities.
*
;
import
edu.nps.moves.dis7.utilities.
DisTime
;
import
edu.nps.moves.dis7.utilities.PduFactory
;
import
java.io.IOException
;
import
java.net.*
;
import
java.nio.ByteBuffer
;
...
...
@@ -27,7 +26,6 @@ public class NetworkComms implements Runnable
private
PduFactory
pduFactory
;
private
DatagramPacket
sendPacket
,
receivePacket
;
private
ByteBuffer
buffSend
,
buffReceive
;
private
DisTime
time
;
/** people we notify when we receive a PDU */
private
List
<
PduListener
>
listeners
;
...
...
@@ -57,8 +55,6 @@ public class NetworkComms implements Runnable
try
{
time
=
new
DisTime
();
// Some fancy footwork to allow us to open a UDP socket even if
// anther program has already opened a socket on that port. Opens
// on the wildcard address, i.e. all configured interfaces, both
...
...
@@ -116,7 +112,7 @@ public class NetworkComms implements Runnable
* @param aPdu to send */
public
void
sendPdu
(
Pdu
aPdu
)
{
aPdu
.
setTimestamp
(
t
ime
.
getDisAbsoluteTimestamp
());
aPdu
.
setTimestamp
(
DisT
ime
.
get
Current
DisAbsoluteTimestamp
());
try
{
sendPacket
.
setData
(
aPdu
.
marshal
());
if
(!
socket
.
isClosed
())
...
...
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