From 909ca3f6ee4d4d4af0af8c1fe5405900914d6499 Mon Sep 17 00:00:00 2001 From: terry-norbraten <tnorb@comcast.net> Date: Mon, 27 Jul 2020 16:20:27 -0700 Subject: [PATCH] rename util method --- src/edu/nps/moves/dis7/examples/EspduReceiver.java | 2 +- src/edu/nps/moves/dis7/examples/EspduReceiverNIO.java | 2 +- src/edu/nps/moves/dis7/examples/EspduSender.java | 2 +- src/edu/nps/moves/dis7/examples/EspduSenderNIO.java | 2 +- src/edu/nps/moves/dis7/examples/PduSender.java | 2 +- src/edu/nps/moves/dis7/utilities/DisNetworking.java | 2 +- src/edu/nps/moves/dis7/utilities/DisThreadedNetIF.java | 6 +++--- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/edu/nps/moves/dis7/examples/EspduReceiver.java b/src/edu/nps/moves/dis7/examples/EspduReceiver.java index 32c8d172fb..0507def195 100644 --- a/src/edu/nps/moves/dis7/examples/EspduReceiver.java +++ b/src/edu/nps/moves/dis7/examples/EspduReceiver.java @@ -43,7 +43,7 @@ public class EspduReceiver InetAddress maddr = InetAddress.getByName(DisThreadedNetIF.DEFAULT_MCAST_GROUP); InetSocketAddress group = new InetSocketAddress(maddr, DisThreadedNetIF.DEFAULT_DIS_PORT); - socket.joinGroup(group, DisThreadedNetIF.findIp4Interface()); + socket.joinGroup(group, DisThreadedNetIF.findIpv4Interface()); // Loop infinitely, receiving datagrams EntityID eid; diff --git a/src/edu/nps/moves/dis7/examples/EspduReceiverNIO.java b/src/edu/nps/moves/dis7/examples/EspduReceiverNIO.java index 864e73833f..c286a4490e 100644 --- a/src/edu/nps/moves/dis7/examples/EspduReceiverNIO.java +++ b/src/edu/nps/moves/dis7/examples/EspduReceiverNIO.java @@ -37,7 +37,7 @@ public class EspduReceiverNIO socket = new MulticastSocket(DisThreadedNetIF.DEFAULT_DIS_PORT); maddr = InetAddress.getByName(DisThreadedNetIF.DEFAULT_MCAST_GROUP); group = new InetSocketAddress(maddr, DisThreadedNetIF.DEFAULT_DIS_PORT); - socket.joinGroup(group, DisThreadedNetIF.findIp4Interface()); + socket.joinGroup(group, DisThreadedNetIF.findIpv4Interface()); // Loop infinitely, receiving datagrams while (true) { diff --git a/src/edu/nps/moves/dis7/examples/EspduSender.java b/src/edu/nps/moves/dis7/examples/EspduSender.java index 57c5a6a93e..da3de0fc93 100644 --- a/src/edu/nps/moves/dis7/examples/EspduSender.java +++ b/src/edu/nps/moves/dis7/examples/EspduSender.java @@ -97,7 +97,7 @@ public class EspduSender } InetSocketAddress group = new InetSocketAddress(destinationIp, port); - socket.joinGroup(group, DisThreadedNetIF.findIp4Interface()); + socket.joinGroup(group, DisThreadedNetIF.findIpv4Interface()); } } // end networkModeString } diff --git a/src/edu/nps/moves/dis7/examples/EspduSenderNIO.java b/src/edu/nps/moves/dis7/examples/EspduSenderNIO.java index eee5fa998c..283c6adc2c 100644 --- a/src/edu/nps/moves/dis7/examples/EspduSenderNIO.java +++ b/src/edu/nps/moves/dis7/examples/EspduSenderNIO.java @@ -45,7 +45,7 @@ public class EspduSenderNIO socket = new MulticastSocket(DisThreadedNetIF.DEFAULT_DIS_PORT); maddr = InetAddress.getByName(DisThreadedNetIF.DEFAULT_MCAST_GROUP); group = new InetSocketAddress(maddr, DisThreadedNetIF.DEFAULT_DIS_PORT); - socket.joinGroup(group, DisThreadedNetIF.findIp4Interface()); + socket.joinGroup(group, DisThreadedNetIF.findIpv4Interface()); Vector3Double location; EulerAngles orientation; diff --git a/src/edu/nps/moves/dis7/examples/PduSender.java b/src/edu/nps/moves/dis7/examples/PduSender.java index 7cebe11699..dfe38c47dd 100644 --- a/src/edu/nps/moves/dis7/examples/PduSender.java +++ b/src/edu/nps/moves/dis7/examples/PduSender.java @@ -292,7 +292,7 @@ public class PduSender InetAddress localMulticastAddress = InetAddress.getByName(DisThreadedNetIF.DEFAULT_MCAST_GROUP); MulticastSocket socket = new MulticastSocket(port); InetSocketAddress group = new InetSocketAddress(localMulticastAddress, port); - socket.joinGroup(group, DisThreadedNetIF.findIp4Interface()); + socket.joinGroup(group, DisThreadedNetIF.findIpv4Interface()); ByteArrayOutputStream baos = new ByteArrayOutputStream(); DataOutputStream dos = new DataOutputStream(baos); diff --git a/src/edu/nps/moves/dis7/utilities/DisNetworking.java b/src/edu/nps/moves/dis7/utilities/DisNetworking.java index e63c06987e..fd01d76093 100644 --- a/src/edu/nps/moves/dis7/utilities/DisNetworking.java +++ b/src/edu/nps/moves/dis7/utilities/DisNetworking.java @@ -61,7 +61,7 @@ public class DisNetworking Logger.getLogger(DisNetworking.class.getName()).log(Level.SEVERE, null, ex); } group = new InetSocketAddress(maddr, DIS_PORT); - ni = DisThreadedNetIF.findIp4Interface(); + ni = DisThreadedNetIF.findIpv4Interface(); baos = new ByteArrayOutputStream(); dos = new DataOutputStream(baos); } diff --git a/src/edu/nps/moves/dis7/utilities/DisThreadedNetIF.java b/src/edu/nps/moves/dis7/utilities/DisThreadedNetIF.java index 1233f27c87..81cf58fd21 100644 --- a/src/edu/nps/moves/dis7/utilities/DisThreadedNetIF.java +++ b/src/edu/nps/moves/dis7/utilities/DisThreadedNetIF.java @@ -100,7 +100,7 @@ public class DisThreadedNetIF Logger.getLogger(DisThreadedNetIF.class.getName()).log(Level.SEVERE, null, ex); } group = new InetSocketAddress(maddr, disPort); - ni = findIp4Interface(); + ni = findIpv4Interface(); init(); } @@ -334,11 +334,11 @@ public class DisThreadedNetIF } /** - * Find proper interface + * Find proper IPV4 interface * * @return a network interface to use to join a multicast group */ - public static NetworkInterface findIp4Interface() { + public static NetworkInterface findIpv4Interface() { try { Enumeration<NetworkInterface> ifaces = NetworkInterface.getNetworkInterfaces(); NetworkInterface nif; -- GitLab