Skip to content
Snippets Groups Projects
Commit 909ca3f6 authored by terry-norbraten's avatar terry-norbraten
Browse files

rename util method

parent a767d157
No related branches found
No related tags found
No related merge requests found
...@@ -43,7 +43,7 @@ public class EspduReceiver ...@@ -43,7 +43,7 @@ public class EspduReceiver
InetAddress maddr = InetAddress.getByName(DisThreadedNetIF.DEFAULT_MCAST_GROUP); InetAddress maddr = InetAddress.getByName(DisThreadedNetIF.DEFAULT_MCAST_GROUP);
InetSocketAddress group = new InetSocketAddress(maddr, DisThreadedNetIF.DEFAULT_DIS_PORT); InetSocketAddress group = new InetSocketAddress(maddr, DisThreadedNetIF.DEFAULT_DIS_PORT);
socket.joinGroup(group, DisThreadedNetIF.findIp4Interface()); socket.joinGroup(group, DisThreadedNetIF.findIpv4Interface());
// Loop infinitely, receiving datagrams // Loop infinitely, receiving datagrams
EntityID eid; EntityID eid;
......
...@@ -37,7 +37,7 @@ public class EspduReceiverNIO ...@@ -37,7 +37,7 @@ public class EspduReceiverNIO
socket = new MulticastSocket(DisThreadedNetIF.DEFAULT_DIS_PORT); socket = new MulticastSocket(DisThreadedNetIF.DEFAULT_DIS_PORT);
maddr = InetAddress.getByName(DisThreadedNetIF.DEFAULT_MCAST_GROUP); maddr = InetAddress.getByName(DisThreadedNetIF.DEFAULT_MCAST_GROUP);
group = new InetSocketAddress(maddr, DisThreadedNetIF.DEFAULT_DIS_PORT); group = new InetSocketAddress(maddr, DisThreadedNetIF.DEFAULT_DIS_PORT);
socket.joinGroup(group, DisThreadedNetIF.findIp4Interface()); socket.joinGroup(group, DisThreadedNetIF.findIpv4Interface());
// Loop infinitely, receiving datagrams // Loop infinitely, receiving datagrams
while (true) { while (true) {
......
...@@ -97,7 +97,7 @@ public class EspduSender ...@@ -97,7 +97,7 @@ public class EspduSender
} }
InetSocketAddress group = new InetSocketAddress(destinationIp, port); InetSocketAddress group = new InetSocketAddress(destinationIp, port);
socket.joinGroup(group, DisThreadedNetIF.findIp4Interface()); socket.joinGroup(group, DisThreadedNetIF.findIpv4Interface());
} }
} // end networkModeString } // end networkModeString
} }
......
...@@ -45,7 +45,7 @@ public class EspduSenderNIO ...@@ -45,7 +45,7 @@ public class EspduSenderNIO
socket = new MulticastSocket(DisThreadedNetIF.DEFAULT_DIS_PORT); socket = new MulticastSocket(DisThreadedNetIF.DEFAULT_DIS_PORT);
maddr = InetAddress.getByName(DisThreadedNetIF.DEFAULT_MCAST_GROUP); maddr = InetAddress.getByName(DisThreadedNetIF.DEFAULT_MCAST_GROUP);
group = new InetSocketAddress(maddr, DisThreadedNetIF.DEFAULT_DIS_PORT); group = new InetSocketAddress(maddr, DisThreadedNetIF.DEFAULT_DIS_PORT);
socket.joinGroup(group, DisThreadedNetIF.findIp4Interface()); socket.joinGroup(group, DisThreadedNetIF.findIpv4Interface());
Vector3Double location; Vector3Double location;
EulerAngles orientation; EulerAngles orientation;
......
...@@ -292,7 +292,7 @@ public class PduSender ...@@ -292,7 +292,7 @@ public class PduSender
InetAddress localMulticastAddress = InetAddress.getByName(DisThreadedNetIF.DEFAULT_MCAST_GROUP); InetAddress localMulticastAddress = InetAddress.getByName(DisThreadedNetIF.DEFAULT_MCAST_GROUP);
MulticastSocket socket = new MulticastSocket(port); MulticastSocket socket = new MulticastSocket(port);
InetSocketAddress group = new InetSocketAddress(localMulticastAddress, port); InetSocketAddress group = new InetSocketAddress(localMulticastAddress, port);
socket.joinGroup(group, DisThreadedNetIF.findIp4Interface()); socket.joinGroup(group, DisThreadedNetIF.findIpv4Interface());
ByteArrayOutputStream baos = new ByteArrayOutputStream(); ByteArrayOutputStream baos = new ByteArrayOutputStream();
DataOutputStream dos = new DataOutputStream(baos); DataOutputStream dos = new DataOutputStream(baos);
......
...@@ -61,7 +61,7 @@ public class DisNetworking ...@@ -61,7 +61,7 @@ public class DisNetworking
Logger.getLogger(DisNetworking.class.getName()).log(Level.SEVERE, null, ex); Logger.getLogger(DisNetworking.class.getName()).log(Level.SEVERE, null, ex);
} }
group = new InetSocketAddress(maddr, DIS_PORT); group = new InetSocketAddress(maddr, DIS_PORT);
ni = DisThreadedNetIF.findIp4Interface(); ni = DisThreadedNetIF.findIpv4Interface();
baos = new ByteArrayOutputStream(); baos = new ByteArrayOutputStream();
dos = new DataOutputStream(baos); dos = new DataOutputStream(baos);
} }
......
...@@ -100,7 +100,7 @@ public class DisThreadedNetIF ...@@ -100,7 +100,7 @@ public class DisThreadedNetIF
Logger.getLogger(DisThreadedNetIF.class.getName()).log(Level.SEVERE, null, ex); Logger.getLogger(DisThreadedNetIF.class.getName()).log(Level.SEVERE, null, ex);
} }
group = new InetSocketAddress(maddr, disPort); group = new InetSocketAddress(maddr, disPort);
ni = findIp4Interface(); ni = findIpv4Interface();
init(); init();
} }
...@@ -334,11 +334,11 @@ public class DisThreadedNetIF ...@@ -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 * @return a network interface to use to join a multicast group
*/ */
public static NetworkInterface findIp4Interface() { public static NetworkInterface findIpv4Interface() {
try { try {
Enumeration<NetworkInterface> ifaces = NetworkInterface.getNetworkInterfaces(); Enumeration<NetworkInterface> ifaces = NetworkInterface.getNetworkInterfaces();
NetworkInterface nif; NetworkInterface nif;
......
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