Class PduSender
java.lang.Object
edu.nps.moves.dis7.examples.PduSender
Creates and sends ESPDUs in IEEE binary format.
This is legacy code ported to the edu.nps.moves.dis7 package
- Author:
- DMcG, Mike Bailey
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
default value avoids unterminated zombie senders -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Set
<InetAddress> A number of sites get all snippy about using 255.255.255.255 for a broadcast address; it trips their security software and they kick you off their network.static void
Possible system properties, passed in via -Dattr=val networkMode: unicast, broadcast, multicast destinationIp: where to send the packet.
-
Field Details
-
NUMBER_TO_SEND
public static final int NUMBER_TO_SENDdefault value avoids unterminated zombie senders- See Also:
-
-
Constructor Details
-
PduSender
public PduSender()default constructor
-
-
Method Details
-
main
Possible system properties, passed in via -Dattr=val networkMode: unicast, broadcast, multicast destinationIp: where to send the packet. If in multicast mode, this can be multicast. To determine broadcast destination IP, use an online broadcast address calculator, for example http://www.remotemonitoringsystems.ca/broadcast.php If in multicast mode, a join() will be done on the multicast address. port: port used for both source and destination.- Parameters:
args
- command-line arguments
-
getBroadcastAddresses
A number of sites get all snippy about using 255.255.255.255 for a broadcast address; it trips their security software and they kick you off their network. (Comcast, NPS.) This determines the broadcast address for all connected interfaces, based on the IP and subnet mask. If you have a dual-homed host it will return a broadcast address for both. If you have some VMs running on your host this will pick up the addresses for those as well--eg running VMWare on your laptop with a local IP this will also pick up a 192.168 address assigned to the VM by the host OS.- Returns:
- set of all broadcast addresses
-