Skip to content
Snippets Groups Projects
Commit 045578c7 authored by Terry D. Norbraten's avatar Terry D. Norbraten
Browse files

consolidate vars

parent 0679d00d
No related branches found
No related tags found
No related merge requests found
...@@ -167,6 +167,7 @@ public class DisThreadedNetIF ...@@ -167,6 +167,7 @@ public class DisThreadedNetIF
private Thread receiver; private Thread receiver;
private MulticastSocket socket = null; private MulticastSocket socket = null;
private InetAddress maddr;
private void init() private void init()
{ {
...@@ -186,8 +187,7 @@ public class DisThreadedNetIF ...@@ -186,8 +187,7 @@ public class DisThreadedNetIF
byte buffer[] = new byte[MAX_DIS_PDU_SIZE]; byte buffer[] = new byte[MAX_DIS_PDU_SIZE];
DatagramPacket packet = new DatagramPacket(buffer, buffer.length); DatagramPacket packet = new DatagramPacket(buffer, buffer.length);
InetAddress maddr; InetSocketAddress group;
InetSocketAddress group = null;
Pdu pdu; Pdu pdu;
ByteBuffer byteBuffer; ByteBuffer byteBuffer;
...@@ -232,16 +232,13 @@ public class DisThreadedNetIF ...@@ -232,16 +232,13 @@ public class DisThreadedNetIF
private final Runnable sendThread = () -> { private final Runnable sendThread = () -> {
InetAddress maddr;
Pdu pdu; Pdu pdu;
byte[] data; byte[] data;
DatagramPacket packet; DatagramPacket packet;
ByteArrayOutputStream baos = new ByteArrayOutputStream(); ByteArrayOutputStream baos = new ByteArrayOutputStream();
DataOutputStream dos = new DataOutputStream(baos); DataOutputStream dos = new DataOutputStream(baos);
while (!killed) {
try { try {
maddr = InetAddress.getByName(mcastGroup);
while (!killed) { while (!killed) {
pdu = pdus2send.take(); pdu = pdus2send.take();
...@@ -272,7 +269,6 @@ public class DisThreadedNetIF ...@@ -272,7 +269,6 @@ public class DisThreadedNetIF
} }
if (!killed) if (!killed)
sleep(5000); sleep(5000);
}
}; };
private void toListeners(Pdu pdu) private void toListeners(Pdu pdu)
......
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