Class PduSender

java.lang.Object
edu.nps.moves.dis7.examples.PduSender

public class PduSender extends Object
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
    Modifier and Type
    Class
    Description
    static enum 
    TCP/IP network modes
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    default value avoids unterminated zombie senders
  • Constructor Summary

    Constructors
    Constructor
    Description
    default constructor
  • Method Summary

    Modifier and Type
    Method
    Description
    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
    main(String[] args)
    Possible system properties, passed in via -Dattr=val networkMode: unicast, broadcast, multicast destinationIp: where to send the packet.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • NUMBER_TO_SEND

      public static final int NUMBER_TO_SEND
      default value avoids unterminated zombie senders
      See Also:
  • Constructor Details

    • PduSender

      public PduSender()
      default constructor
  • Method Details

    • main

      public static void main(String[] args)
      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

      public static Set<InetAddress> 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