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

use given local vars

parent 909ca3f6
No related branches found
No related tags found
No related merge requests found
...@@ -69,6 +69,7 @@ public class EspduSender ...@@ -69,6 +69,7 @@ public class EspduSender
// Network mode: unicast, multicast, broadcast // Network mode: unicast, multicast, broadcast
String networkModeString = systemProperties.getProperty("networkMode"); // unicast or multicast or broadcast String networkModeString = systemProperties.getProperty("networkMode"); // unicast or multicast or broadcast
InetSocketAddress group = null;
// Set up a socket to send information // Set up a socket to send information
try { try {
...@@ -76,7 +77,7 @@ public class EspduSender ...@@ -76,7 +77,7 @@ public class EspduSender
if (portString != null) if (portString != null)
port = Integer.parseInt(portString); port = Integer.parseInt(portString);
socket = new MulticastSocket(port); socket = new MulticastSocket();
// Where we send packets to, the destination IP address // Where we send packets to, the destination IP address
if (destinationIpString != null) { if (destinationIpString != null) {
...@@ -96,7 +97,7 @@ public class EspduSender ...@@ -96,7 +97,7 @@ public class EspduSender
throw new RuntimeException("Sending to multicast address, but destination address " + destinationIp.toString() + " is not multicast"); throw new RuntimeException("Sending to multicast address, but destination address " + destinationIp.toString() + " is not multicast");
} }
InetSocketAddress group = new InetSocketAddress(destinationIp, port); group = new InetSocketAddress(destinationIp, port);
socket.joinGroup(group, DisThreadedNetIF.findIpv4Interface()); socket.joinGroup(group, DisThreadedNetIF.findIpv4Interface());
} }
} // end networkModeString } // end networkModeString
...@@ -232,10 +233,10 @@ public class EspduSender ...@@ -232,10 +233,10 @@ public class EspduSender
for (InetAddress broadcast : broadcastAddresses) { for (InetAddress broadcast : broadcastAddresses) {
System.out.println("Sending broadcast datagram packet to " + broadcast); System.out.println("Sending broadcast datagram packet to " + broadcast);
packet = new DatagramPacket(data, data.length, broadcast, DisThreadedNetIF.DEFAULT_DIS_PORT); packet = new DatagramPacket(data, data.length, broadcast, port);
socket.send(packet); socket.send(packet);
// TODO experiment with these! 8) // TODO experiment with these! 8)
packet = new DatagramPacket(fireArray, fireArray.length, broadcast, DisThreadedNetIF.DEFAULT_DIS_PORT); // alternate packet = new DatagramPacket(fireArray, fireArray.length, broadcast, port); // alternate
socket.send(packet); socket.send(packet);
} }
......
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