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
cfa2f50a
Commit
cfa2f50a
authored
5 years ago
by
Terry D. Norbraten
Browse files
Options
Downloads
Patches
Plain Diff
javadoc
parent
af774331
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
src/edu/nps/moves/dis7/utilities/DisThreadedNetIF.java
+16
-7
16 additions, 7 deletions
src/edu/nps/moves/dis7/utilities/DisThreadedNetIF.java
with
16 additions
and
7 deletions
src/edu/nps/moves/dis7/utilities/DisThreadedNetIF.java
+
16
−
7
View file @
cfa2f50a
...
...
@@ -17,21 +17,23 @@ import java.util.logging.Level;
import
java.util.logging.Logger
;
/**
* DisThreadedNetIF.java created on Jul 29, 2019
* DisThreadedNetIF.java created on Jul 29, 2019.
* <pre>
* This is a thread-safe, multicast DIS network interface class.
* </pre>
*
* @author Mike Bailey, jmbailey@nps.edu
* @version $Id$
*/
public
class
DisThreadedNetIF
{
/*
*********
* Pdu listener interface
***********
*/
/** Pdu listener interface */
public
interface
PduListener
{
void
incomingPdu
(
Pdu
pdu
);
}
/*
****
* Raw pdu listener class and interface
********
*/
/** Raw pdu listener class and interface */
public
interface
RawPduListener
{
void
incomingPdu
(
BuffAndLength
bAndL
);
...
...
@@ -57,7 +59,6 @@ public class DisThreadedNetIF
}
}
/************ Begin class ***************/
public
static
int
DEFAULT_DIS_PORT
=
3000
;
...
...
@@ -74,11 +75,19 @@ public class DisThreadedNetIF
private
MulticastSocket
ssocket
=
null
;
private
MulticastSocket
rsocket
=
null
;
/**
* Default constructor using default port 3000 and multicast address 225.4.5.6
*/
public
DisThreadedNetIF
()
{
this
(
DEFAULT_DIS_PORT
,
DEFAULT_MCAST_GROUP
);
}
/**
*
* @param port the multicast port to utilize
* @param mcastgroup the multicast group address to utilize
*/
public
DisThreadedNetIF
(
int
port
,
String
mcastgroup
)
{
disPort
=
port
;
...
...
@@ -100,7 +109,7 @@ public class DisThreadedNetIF
private
final
LinkedBlockingQueue
<
Pdu
>
pdus2send
=
new
LinkedBlockingQueue
<>();
/**
* Add a listener to accept only pdus of
the
given typ
* Add a listener to accept only pdus of
a
given typ
* @param lis instance of PduListener
* @param typ Pdu type
*/
...
...
@@ -152,7 +161,7 @@ public class DisThreadedNetIF
}
/**
* Remove previously add raw listener
* Remove previously add
ed
raw listener
* @param lis
*/
public
void
removeRawListener
(
RawPduListener
lis
)
...
...
@@ -171,7 +180,7 @@ public class DisThreadedNetIF
}
/**
* Sen
t
the given pdu to the network
,
using the ip and port given to the constructor
* Sen
d
the given pdu to the network using the ip and port given to the constructor
* @param pdu
*/
public
void
send
(
Pdu
pdu
)
...
...
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