Skip to content
Snippets Groups Projects
Commit 0bbb5e9f authored by Brutzman, Don's avatar Brutzman, Don
Browse files

fix imports, proper declaration of Enumeration<NetworkInterface>

parent 474b3d30
No related branches found
No related tags found
No related merge requests found
package OpenDis7Examples; package OpenDis7Examples;
import java.io.*; import edu.nps.moves.dis7.entities.usa.platform.land.M1A2;
import java.net.*;
import java.util.*;
import edu.nps.moves.dis7.pdus.*;
import edu.nps.moves.dis7.enumerations.Country; import edu.nps.moves.dis7.enumerations.Country;
import edu.nps.moves.dis7.enumerations.EntityKind; import edu.nps.moves.dis7.enumerations.EntityKind;
import edu.nps.moves.dis7.enumerations.PlatformDomain; import edu.nps.moves.dis7.enumerations.PlatformDomain;
import edu.nps.moves.dis7.pdus.*;
import edu.nps.moves.dis7.utilities.*; import edu.nps.moves.dis7.utilities.*;
import edu.nps.moves.dis7.entities.usa.platform.land.M1A2; import java.io.*;
import java.net.*;
import java.util.*;
/** /**
* Creates and sends ESPDUs in IEEE binary format. Adapted from OpenDIS library * Creates and sends ESPDUs in IEEE binary format. Adapted from OpenDIS library
...@@ -394,14 +393,14 @@ public class EspduSender ...@@ -394,14 +393,14 @@ public class EspduSender
public static Set<InetAddress> getBroadcastAddresses() public static Set<InetAddress> getBroadcastAddresses()
{ {
Set<InetAddress> broadcastAddresses = new HashSet<>(); Set<InetAddress> broadcastAddresses = new HashSet<>();
Enumeration interfaces; Enumeration<NetworkInterface> interfaces;
try { try {
interfaces = NetworkInterface.getNetworkInterfaces(); interfaces = NetworkInterface.getNetworkInterfaces();
while (interfaces.hasMoreElements()) while (interfaces.hasMoreElements())
{ {
NetworkInterface anInterface = (NetworkInterface) interfaces.nextElement(); NetworkInterface anInterface = interfaces.nextElement();
if (anInterface.isUp()) if (anInterface.isUp())
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment