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

logging, self test refinements, javadoc

parent f9de4e5e
No related branches found
No related tags found
No related merge requests found
...@@ -153,7 +153,7 @@ public class DisThreadedNetworkInterface ...@@ -153,7 +153,7 @@ public class DisThreadedNetworkInterface
} }
catch (UnknownHostException ex) catch (UnknownHostException ex)
{ {
Logger.getLogger(DisThreadedNetworkInterface.class.getName()).log(Level.SEVERE, null, ex); Logger.getLogger(DisThreadedNetworkInterface.class.getSimpleName()).log(Level.SEVERE, null, ex);
} }
inetSocket = new InetSocketAddress(inetAddress, disPort); // tests that accessor methods are working as set inetSocket = new InetSocketAddress(inetAddress, disPort); // tests that accessor methods are working as set
networkInterface = findIpv4Interface(); networkInterface = findIpv4Interface();
...@@ -431,7 +431,7 @@ public class DisThreadedNetworkInterface ...@@ -431,7 +431,7 @@ public class DisThreadedNetworkInterface
pad = " "; pad = " ";
String message = TRACE_PREFIX + "[receipt " + pad + pduReceiptCounter + "] " + nextPdu.getPduType().toString(); String message = TRACE_PREFIX + "[receipt " + pad + pduReceiptCounter + "] " + nextPdu.getPduType().toString();
if (hasVerboseOutputIncludesTimestamp()) if (hasVerboseOutputIncludesTimestamp())
message += " (timestamp " + DisTime.timestampToString(nextPdu.getTimestamp()); message += " (timestamp " + DisTime.convertToString(nextPdu.getTimestamp());
if (nextPdu.getPduType() == DisPduType.ENTITY_STATE) if (nextPdu.getPduType() == DisPduType.ENTITY_STATE)
message += " " + String.format("%11s", ((EntityStatePdu)nextPdu).getMarkingString()); message += " " + String.format("%11s", ((EntityStatePdu)nextPdu).getMarkingString());
message += ", size " + nextPdu.getMarshalledSize() + " bytes)"; message += ", size " + nextPdu.getMarshalledSize() + " bytes)";
...@@ -480,7 +480,7 @@ public class DisThreadedNetworkInterface ...@@ -480,7 +480,7 @@ public class DisThreadedNetworkInterface
pad = " "; pad = " ";
String message = TRACE_PREFIX + "[sending " + pad + pduSentCounter + "] " + nextPdu.getPduType().toString(); String message = TRACE_PREFIX + "[sending " + pad + pduSentCounter + "] " + nextPdu.getPduType().toString();
if (hasVerboseOutputIncludesTimestamp()) if (hasVerboseOutputIncludesTimestamp())
message += " (timestamp " + DisTime.timestampToString(nextPdu.getTimestamp()); message += " (timestamp " + DisTime.convertToString(nextPdu.getTimestamp());
if (nextPdu.getPduType() == DisPduType.ENTITY_STATE) if (nextPdu.getPduType() == DisPduType.ENTITY_STATE)
message += " " + String.format("%11s", ((EntityStatePdu)nextPdu).getMarkingString()); message += " " + String.format("%11s", ((EntityStatePdu)nextPdu).getMarkingString());
message += ", size " + nextPdu.getMarshalledSize() + " bytes)"; message += ", size " + nextPdu.getMarshalledSize() + " bytes)";
......
...@@ -9,7 +9,7 @@ warning: [options] bootstrap class path not set in conjunction with -source 8 ...@@ -9,7 +9,7 @@ warning: [options] bootstrap class path not set in conjunction with -source 8
compile-single: compile-single:
run-single: run-single:
[DisThreadedNetworkInterface] main() started... [DisThreadedNetworkInterface] main() started...
[DisThreadedNetworkInterface] using network interface Intel(R) Wi-Fi 6E AX210 160MHz [DisThreadedNetworkInterface] using network interface PANGP Virtual Ethernet Adapter
[DisThreadedNetworkInterface main() self test] datagramSocket.joinGroup address=239.1.2.3 port=3000 isConnected()=false createDatagramSocket() complete. [DisThreadedNetworkInterface main() self test] datagramSocket.joinGroup address=239.1.2.3 port=3000 isConnected()=false createDatagramSocket() complete.
[DisThreadedNetworkInterface main() self test] createThreads() receiveThread.isAlive()=true [DisThreadedNetworkInterface main() self test] createThreads() receiveThread.isAlive()=true
[DisThreadedNetworkInterface main() self test] createThreads() sendingThread.isAlive()=true [DisThreadedNetworkInterface main() self test] createThreads() sendingThread.isAlive()=true
...@@ -18,7 +18,7 @@ run-single: ...@@ -18,7 +18,7 @@ run-single:
[DisThreadedNetworkInterface main() self test] [sending 1] DisPduType 01 ENTITY_STATE self test, size 144 bytes) [DisThreadedNetworkInterface main() self test] [sending 1] DisPduType 01 ENTITY_STATE self test, size 144 bytes)
[DisThreadedNetworkInterface main() self test] [receipt 1] DisPduType 01 ENTITY_STATE self test, size 144 bytes) [DisThreadedNetworkInterface main() self test] [receipt 1] DisPduType 01 ENTITY_STATE self test, size 144 bytes)
[DisThreadedNetworkInterface main() self test] main() pduListener.incomingPdu() received newPdu DisPduType 01 ENTITY_STATE [DisThreadedNetworkInterface main() self test] main() pduListener.incomingPdu() received newPdu DisPduType 01 ENTITY_STATE
*** setKillSentinelAndInterrupts() killed=true sendingThread.isInterrupted()=true receiveThread.isInterrupted()=true *** setKillSentinelAndInterrupts() killed=true sendingThread.isInterrupted()=false receiveThread.isInterrupted()=true
[DisThreadedNetworkInterface main() self test] close(): pdus2send.size()=0 baos.size()=0 dos.size()=144 [DisThreadedNetworkInterface main() self test] close(): pdus2send.size()=0 baos.size()=0 dos.size()=144
[DisThreadedNetworkInterface main() self test] datagramSocket.leaveGroup address=239.1.2.3 port=3000 isClosed()=true close() complete. [DisThreadedNetworkInterface main() self test] datagramSocket.leaveGroup address=239.1.2.3 port=3000 isClosed()=true close() complete.
*** killThread() status: sendingThread.isAlive()=false sendingThread.isInterrupted()=true *** killThread() status: sendingThread.isAlive()=false sendingThread.isInterrupted()=true
......
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