From be7c1f97c2379820fde0a9c93fb873f57dc6cba6 Mon Sep 17 00:00:00 2001
From: brutzman <brutzman@nps.edu>
Date: Sun, 5 Jun 2022 11:53:51 -0700
Subject: [PATCH] javadoc, clear warnings

---
 .../DisDemo/src/DisDemo/DisDemonstration.java |   9 +-
 .../src/DisShooting/PduListenerImpl.java      |   8 +-
 .../HttpWebPageSource.java                    |   9 +-
 .../src/OpenDis4Examples/EspduReceiver.java   |   5 +
 .../src/OpenDis4Examples/EspduSender.java     |   9 +-
 .../src/OpenDis4Examples/PduReceiver.java     |   5 +
 .../src/OpenDis7Examples/AllPduReceiver.java  |   5 +
 .../src/OpenDis7Examples/EspduReceiver.java   |   5 +
 .../src/OpenDis7Examples/EspduSender.java     |   5 +
 .../ExampleSimulationProgram.java             |  14 +-
 .../ExampleTrackInterpolation.java            |   9 +-
 .../src/OpenDis7Examples/PduReaderPlayer.java |   5 +
 .../Assignment1TCPExample3ClientChange.java   |   9 +-
 .../Assignmnet1TCPExample3ServerChange.java   | 219 +++++++++---------
 .../src/TcpExamples/TcpExample1Telnet.java    |   5 +
 .../TcpExample2ConnectionCounting.java        |   5 +
 .../src/TcpExamples/TcpExample3Client.java    |   8 +-
 .../src/TcpExamples/TcpExample3Server.java    |   8 +-
 .../src/TcpExamples/TcpExample4Client.java    |   5 +
 .../TcpExample4DispatchServer.java            |   9 +-
 .../src/UdpExamples/MulticastUdpReceiver.java |   9 +-
 .../src/UdpExamples/MulticastUdpSender.java   |   5 +
 .../src/UdpExamples/UnicastUdpReceiver.java   |   7 +-
 .../src/UdpExamples/UnicastUdpSender.java     |   5 +
 24 files changed, 254 insertions(+), 128 deletions(-)

diff --git a/examples/DisDemo/src/DisDemo/DisDemonstration.java b/examples/DisDemo/src/DisDemo/DisDemonstration.java
index 877eb78a45..bd52fd8017 100644
--- a/examples/DisDemo/src/DisDemo/DisDemonstration.java
+++ b/examples/DisDemo/src/DisDemo/DisDemonstration.java
@@ -19,8 +19,13 @@ import java.util.*;
  * Simple DIS demonstration program
  * @author DMcG
  */
-public class DisDemonstration {
-
+public class DisDemonstration
+{
+    /** Default constructor */
+    public DisDemonstration()
+    {
+        // default constructor
+    }
     /**
      * Program invocation, execution starts here
      * @param args command-line arguments
diff --git a/examples/DisShooting/src/DisShooting/PduListenerImpl.java b/examples/DisShooting/src/DisShooting/PduListenerImpl.java
index 9f0ad93221..7bb7eda79e 100644
--- a/examples/DisShooting/src/DisShooting/PduListenerImpl.java
+++ b/examples/DisShooting/src/DisShooting/PduListenerImpl.java
@@ -14,7 +14,13 @@ import java.util.Set;
  *
  * @author &lt;a href="mailto:tdnorbra@nps.edu?subject=mv4503.PduListenerImpl"&gt;Terry Norbraten, NPS MOVES&lt;/a&gt;
  */
-public class PduListenerImpl implements PduListener {
+public class PduListenerImpl implements PduListener
+{
+    /** Default constructor */
+    public PduListenerImpl()
+    {
+        // default constructor
+    }
     
     /** All ENTITIES in the world we have heard from */
     static final Map<EntityID, EntityStatePdu> ENTITIES = Collections.synchronizedMap(new HashMap<>());
diff --git a/examples/src/HttpServletExamples/HttpWebPageSource.java b/examples/src/HttpServletExamples/HttpWebPageSource.java
index 6ca65b9099..fddaf92db1 100644
--- a/examples/src/HttpServletExamples/HttpWebPageSource.java
+++ b/examples/src/HttpServletExamples/HttpWebPageSource.java
@@ -10,8 +10,13 @@ import java.net.*;
  * @author mcgredo
  * @author brutzman
  */
-public class HttpWebPageSource {
-
+public class HttpWebPageSource
+{
+    /** Default constructor */
+    public HttpWebPageSource()
+    {
+        // default constructor
+    }
     /**
      * Program invocation, execution starts here
      * @param args command-line arguments
diff --git a/examples/src/OpenDis4Examples/EspduReceiver.java b/examples/src/OpenDis4Examples/EspduReceiver.java
index d5cfe9dcd0..48acbf4185 100644
--- a/examples/src/OpenDis4Examples/EspduReceiver.java
+++ b/examples/src/OpenDis4Examples/EspduReceiver.java
@@ -17,6 +17,11 @@ import java.io.IOException;
  */
 public class EspduReceiver
 {
+    /** Default constructor */
+    public EspduReceiver()
+    {
+        // default constructor
+    }
     /** Max size of a PDU in binary format that we can receive. This is actually
      * somewhat outdated--PDUs can be larger--but this is a reasonable starting point.
      */
diff --git a/examples/src/OpenDis4Examples/EspduSender.java b/examples/src/OpenDis4Examples/EspduSender.java
index 62b466a4f4..357736be83 100644
--- a/examples/src/OpenDis4Examples/EspduSender.java
+++ b/examples/src/OpenDis4Examples/EspduSender.java
@@ -14,8 +14,13 @@ import edu.nps.moves.disutil.DisTime;
  *
  * @author DMcG
  */
-public class EspduSender {
-
+public class EspduSender
+{
+    /** Default constructor */
+    public EspduSender()
+    {
+        // default constructor
+    }
     /** Defining number of packets to send is superior to infinite loops
       * which have possible hazard of unstoppably sending packets as a zombie process */
 	public static final int NUMBER_TO_SEND = 5; // 5000;
diff --git a/examples/src/OpenDis4Examples/PduReceiver.java b/examples/src/OpenDis4Examples/PduReceiver.java
index c5e6adb645..63d7e99577 100644
--- a/examples/src/OpenDis4Examples/PduReceiver.java
+++ b/examples/src/OpenDis4Examples/PduReceiver.java
@@ -11,6 +11,11 @@ import java.io.IOException;
 /** Listen for IEEE DIS Protocol Data Units (PDUs) */
 public class PduReceiver 
 {
+    /** Default constructor */
+    public PduReceiver()
+    {
+        // default constructor
+    }
     private static final int    MULTICAST_PORT  = 3000;
     private static final String MULTICAST_GROUP = "239.1.2.3";
     private static final boolean USE_FAST_ESPDU = false;
diff --git a/examples/src/OpenDis7Examples/AllPduReceiver.java b/examples/src/OpenDis7Examples/AllPduReceiver.java
index b88e6096de..4080b37737 100644
--- a/examples/src/OpenDis7Examples/AllPduReceiver.java
+++ b/examples/src/OpenDis7Examples/AllPduReceiver.java
@@ -13,6 +13,11 @@ import java.util.List;
 /** Listen to all kinds of PDUs and report them */
 public class AllPduReceiver
 {
+    /** Default constructor */
+    public AllPduReceiver()
+    {
+        // default constructor
+    }
     /** default multicast address
      * @see <a href="https://en.wikipedia.org/wiki/Multicast_address">https://en.wikipedia.org/wiki/Multicast_address</a> */
     public static final String  DEFAULT_MULTICAST_ADDRESS = AllPduSender.DEFAULT_MULTICAST_ADDRESS;
diff --git a/examples/src/OpenDis7Examples/EspduReceiver.java b/examples/src/OpenDis7Examples/EspduReceiver.java
index b0da45928d..2c31c8f46f 100755
--- a/examples/src/OpenDis7Examples/EspduReceiver.java
+++ b/examples/src/OpenDis7Examples/EspduReceiver.java
@@ -15,6 +15,11 @@ import java.util.*;
  */
 public class EspduReceiver
 {
+    /** Default constructor */
+    public EspduReceiver()
+    {
+        // default constructor
+    }
     /** Max size of a PDU in binary format that we can receive. This is actually
      * somewhat outdated--PDUs can be larger--but this is a reasonable starting point.
      */
diff --git a/examples/src/OpenDis7Examples/EspduSender.java b/examples/src/OpenDis7Examples/EspduSender.java
index a4b05f2a79..610f6b553c 100644
--- a/examples/src/OpenDis7Examples/EspduSender.java
+++ b/examples/src/OpenDis7Examples/EspduSender.java
@@ -19,6 +19,11 @@ import java.util.*;
  */
 public class EspduSender
 {
+    /** Default constructor */
+    public EspduSender()
+    {
+        // default constructor
+    }
 	/**
 	 * Number of complete loops to perform.
      * Putting any upper limit on # packets sent avoids possibility of non-terminating infinite loops that continue sending packets. */
diff --git a/examples/src/OpenDis7Examples/ExampleSimulationProgram.java b/examples/src/OpenDis7Examples/ExampleSimulationProgram.java
index 1788200185..bdc247f29c 100644
--- a/examples/src/OpenDis7Examples/ExampleSimulationProgram.java
+++ b/examples/src/OpenDis7Examples/ExampleSimulationProgram.java
@@ -26,7 +26,9 @@ public class ExampleSimulationProgram
     /* **************************** infrastructure code, modification is seldom needed ************************* */
                  
     private   String     descriptor = this.getClass().getSimpleName();
+    /** DIS channel defined by network address/port combination includes multiple utility capabilities */
     protected DisChannel disChannel;
+    /** Factory object used to create new PDU instances */
     protected PduFactory pduFactory;
     
     /** seconds for real-time execution (not simulation time, which may or may not be .the same) */
@@ -65,6 +67,10 @@ public class ExampleSimulationProgram
     {
         initialize();
     }
+    /**
+     * Constructor to create an instance of this class.
+     * @param newDescriptor describes this program, useful for logging and debugging
+     */
     public ExampleSimulationProgram(String newDescriptor)
     {
         descriptor = newDescriptor;
@@ -229,8 +235,9 @@ public class ExampleSimulationProgram
             System.out.flush();
             
             sendAllPdusForLoopTimestep(entityStatePdu_1, 
-                                                   firePdu_1a, 
-                     disChannel.currentTimeStepCommentType, narrativeMessage1, narrativeMessage2, narrativeMessage3);
+                                            firePdu_1a, 
+                                         disChannel.COMMENTPDU_APPLICATION_STATUS, 
+                                           narrativeMessage1, narrativeMessage2, narrativeMessage3);
             disChannel.sendSinglePdu(entityStatePdu_2); // me too i.e. 2!
             
             System.out.println ("... [PDUs of interest successfully sent for this loop]");
@@ -249,7 +256,7 @@ public class ExampleSimulationProgram
 
         narrativeMessage2 = "runSimulation() completed successfully"; // all done, so tell everyone else on the channel
         // TODO better javadoc needs to be autogenerated for VariableRecordType enumerations
-        disChannel.sendCommentPdu(disChannel.narrativeCommentType, narrativeMessage1, narrativeMessage2, narrativeMessage3);
+        disChannel.sendCommentPdu(disChannel.COMMENTPDU_NARRATIVE, narrativeMessage1, narrativeMessage2, narrativeMessage3);
         System.out.println ("... [final=completion CommentPdu successfully sent for simulation]");
         
         disChannel.leave(); // embedded SimulationManager is expected to send appropriate PDUs for entity, application shutdown
@@ -267,6 +274,7 @@ public class ExampleSimulationProgram
      * @param firePdu        the FirePDU to send, if any
      * @param commentType    enumeration value describing purpose of the narrative comment
      * @param comments       String array of narrative comments
+     * @see DisChannel
      */
     public void sendAllPdusForLoopTimestep(EntityStatePdu entityStatePdu,
                                    FirePdu firePdu,
diff --git a/examples/src/OpenDis7Examples/ExampleTrackInterpolation.java b/examples/src/OpenDis7Examples/ExampleTrackInterpolation.java
index cdf6743540..45ca6a89d7 100644
--- a/examples/src/OpenDis7Examples/ExampleTrackInterpolation.java
+++ b/examples/src/OpenDis7Examples/ExampleTrackInterpolation.java
@@ -29,6 +29,11 @@ import java.util.logging.Logger;
  */
 public class ExampleTrackInterpolation extends ExampleSimulationProgram
 {    
+    /** Default constructor */
+    public ExampleTrackInterpolation()
+    {
+        // default constructor
+    }
     // -------------------- Begin Variables for X3D autogenerated code
     private X3dCreateInterpolators x3dInterpolators = new X3dCreateInterpolators();
     private X3dCreateLineSet       x3dLineSet       = new X3dCreateLineSet();
@@ -158,7 +163,7 @@ public class ExampleTrackInterpolation extends ExampleSimulationProgram
                 if (disChannel.getPduRecorder().hasVerboseOutput())
                     System.out.println("sending PDUs for simulation step " + simulationLoopCount + ", monitor loopback to confirm sent");
                 disChannel.sendSinglePdu(espdu_1);
-                disChannel.sendCommentPdu(disChannel.currentTimeStepCommentType, narrativeMessage1, narrativeMessage2, narrativeMessage3);
+                disChannel.sendCommentPdu(disChannel.COMMENTPDU_SIMULATION_TIMESTEP, narrativeMessage1, narrativeMessage2, narrativeMessage3);
                 if (disChannel.getPduRecorder().hasVerboseOutput())
                     System.out.println(disChannel.getTRACE_PREFIX() + "PDUs successfully sent for this loop");
                 pduSentList.add(espdu_1);
@@ -190,7 +195,7 @@ public class ExampleTrackInterpolation extends ExampleSimulationProgram
             System.out.println("=================================");
             
             narrativeMessage2 = "runSimulation() completed successfully"; // all done
-            disChannel.sendCommentPdu(disChannel.narrativeCommentType, narrativeMessage1, narrativeMessage2, narrativeMessage3);
+            disChannel.sendCommentPdu(disChannel.COMMENTPDU_NARRATIVE, narrativeMessage1, narrativeMessage2, narrativeMessage3);
             if (disChannel.getPduRecorder().hasVerboseOutput())
                 disChannel.printlnTRACE("final CommentPdu successfully sent for simulation");
             // TODO simulation management PDUs
diff --git a/examples/src/OpenDis7Examples/PduReaderPlayer.java b/examples/src/OpenDis7Examples/PduReaderPlayer.java
index 71c1786c24..4a81cb52a4 100644
--- a/examples/src/OpenDis7Examples/PduReaderPlayer.java
+++ b/examples/src/OpenDis7Examples/PduReaderPlayer.java
@@ -21,6 +21,11 @@ import java.util.Scanner;
  */
 public class PduReaderPlayer
 {
+    /** Default constructor */
+    public PduReaderPlayer()
+    {
+        // default constructor
+    }
   private final static String DEFAULT_OUTPUT_DIRECTORY = "pduLog";
   /** Default multicast group address we send on.
     * @see <a href="https://en.wikipedia.org/wiki/Multicast_address">https://en.wikipedia.org/wiki/Multicast_address</a> */
diff --git a/examples/src/TcpExamples/Assignment1TCPExample3ClientChange.java b/examples/src/TcpExamples/Assignment1TCPExample3ClientChange.java
index 862a2d1b9f..f96f0b2534 100644
--- a/examples/src/TcpExamples/Assignment1TCPExample3ClientChange.java
+++ b/examples/src/TcpExamples/Assignment1TCPExample3ClientChange.java
@@ -18,8 +18,13 @@ import java.net.*;
  * @author mcgredo
  * @author brutzman
  */
-public class Assignment1TCPExample3ClientChange {
-
+public class Assignment1TCPExample3ClientChange
+{
+    /** Default constructor */
+    public Assignment1TCPExample3ClientChange()
+    {
+        // default constructor
+    }
     /** IPv6 String constant for localhost address, similarly IPv4 127.0.0.1
      * @see <a href="https://en.wikipedia.org/wiki/localhost">https://en.wikipedia.org/wiki/localhost</a>
      * @see <a href="https://en.wikipedia.org/wiki/IPv6_address">https://en.wikipedia.org/wiki/IPv6_address</a> 
diff --git a/examples/src/TcpExamples/Assignmnet1TCPExample3ServerChange.java b/examples/src/TcpExamples/Assignmnet1TCPExample3ServerChange.java
index 5104cf24be..5b2e4bed19 100644
--- a/examples/src/TcpExamples/Assignmnet1TCPExample3ServerChange.java
+++ b/examples/src/TcpExamples/Assignmnet1TCPExample3ServerChange.java
@@ -1,107 +1,112 @@
-package TcpExamples;
-
-import java.io.*;
-import java.net.*;
-
-/**
- * This is Assignment 1 where I have modified the given code from TCPExample3Server
- *-server response message changed
- * 
- * Very slightly more complex than example1, further modifying example2. The
- * only thing this does differently is introduce a loop into the response, so
- * you don't have to restart the program after one response. Also, it prints out
- * the socket pair the server sees. Run the program via telnet several times and
- * compare the socket pairs.
- *
- * telnet (nc) localhost 2317
- *
- * If you're sophisticated you can contact the instructor's computer while
- * running this program.
- *
- *      telnet (nc) [ipNumberOfServerLaptop] 2317
- *
- * and have the instructor display the socket pairs received.
- *
- * @author mcgredo
- * @author brutzman
- */
-public class Assignmnet1TCPExample3ServerChange {
-
-    /**
-     * Program invocation, execution starts here
-     * If already compiled, can run using console in directory ../../build/classes/ by invoking \
-     *      java -classpath . TcpExamples.TcpExample3Server
-     * @param args command-line arguments
-     */
-    public static void main(String[] args) {
-        try {
-            
-            // ServerSocket waits for a connection from a client. 
-            // Notice that it is outside the loop; ServerSocket
-            // needs to be made only once.
-            System.out.println(Assignmnet1TCPExample3ServerChange.class.getName() + " has started..."); // it helps debugging to put this on console first
-            
-            ServerSocket serverSocket = new ServerSocket(2317);
-            OutputStream os;
-            PrintStream ps;
-            InetAddress localAddress, remoteAddress;
-            int localPort, remotePort;
-            int serverLoopCount = 0;
-
-            // Server is up and waiting (i.e. "blocked" or paused)
-            // Loop, infinitely, waiting for client connections.
-            // Stop the program somewhere else.
-            while (true) { 
-                
-                // block until connected to a client
-                try (Socket clientConnectionSocket = serverSocket.accept())
-                {
-                    serverLoopCount++; // increment at beginning of loop for reliability
-                    
-                    // Now hook everything up (i.e. set up the streams), Java style:
-                    os = clientConnectionSocket.getOutputStream();
-                    ps = new PrintStream(os);
-                    ps.println("This is response " + serverLoopCount + " produced by the server, " 
-                            + Assignmnet1TCPExample3ServerChange.class.getName()); // this gets sent back to client!
-                    
-                    // Print some information locally about the Socket connection.
-                    // This includes the port and IP numbers on both sides (the socket pair).
-                     localAddress = clientConnectionSocket.getLocalAddress();
-                    remoteAddress = clientConnectionSocket.getInetAddress();
-                        localPort = clientConnectionSocket.getLocalPort();
-                       remotePort = clientConnectionSocket.getPort();
-                       
-                    System.out.print ("Server loop " + serverLoopCount + ": ");
-                    
-                    // My socket pair connection looks like this, to localhost:
-                    // Socket pair: (( /0:0:0:0:0:0:0:1, 2317 ), ( /0:0:0:0:0:0:0:1, 54876 ))
-                    // Socket pair: (( /0:0:0:0:0:0:0:1, 2317 ), ( /0:0:0:0:0:0:0:1, 54881 ))
-                    
-                    // Why is the first IP/port the same, while the second set has different ports?
-                    System.out.println(TcpExample3Server.class.getName() + " socket pair showing host name, address, port:");
-                    System.out.println("  (( " + 
-                         localAddress.getHostName() + "=" +  localAddress.getHostAddress() + ", " + localPort + " ), ( " + 
-                        remoteAddress.getHostName() + "=" + remoteAddress.getHostAddress() + ", " + remotePort + " ))");
-                    
-                    if ( localAddress.getHostName().equals( localAddress.getHostAddress()) ||
-                        remoteAddress.getHostName().equals(remoteAddress.getHostAddress()))
-                        System.out.println("  note HostName matches address if host has no DNS name");
-                    
-                    // Notice the use of flush() and try w/ resources. Without
-                    // the try w/ resources the Socket object may stay open for
-                    // a while after the client has stopped needing this
-                    // connection. try w/ resources explicitly ends the connection.
-                    ps.flush();
-                    // like it or not, you're outta here!
-                }
-            }
-        } catch (IOException e) {
-            System.err.println("Problem with " + TcpExample3Server.class.getName() + " networking: " + e);
-
-            // Provide more helpful information to user if exception occurs due to running twice at one time
-            if (e instanceof java.net.BindException) {
-                System.err.println("*** Be sure to stop any other running instances of programs using this port!");
-            }
-        }
-    }
-}
+package TcpExamples;
+
+import java.io.*;
+import java.net.*;
+
+/**
+ * This is Assignment 1 where I have modified the given code from TCPExample3Server
+ *-server response message changed
+ * 
+ * Very slightly more complex than example1, further modifying example2. The
+ * only thing this does differently is introduce a loop into the response, so
+ * you don't have to restart the program after one response. Also, it prints out
+ * the socket pair the server sees. Run the program via telnet several times and
+ * compare the socket pairs.
+ *
+ * telnet (nc) localhost 2317
+ *
+ * If you're sophisticated you can contact the instructor's computer while
+ * running this program.
+ *
+ *      telnet (nc) [ipNumberOfServerLaptop] 2317
+ *
+ * and have the instructor display the socket pairs received.
+ *
+ * @author mcgredo
+ * @author brutzman
+ */
+public class Assignmnet1TCPExample3ServerChange
+{
+    /** Default constructor */
+    public Assignmnet1TCPExample3ServerChange()
+    {
+        // default constructor
+    }
+    /**
+     * Program invocation, execution starts here
+     * If already compiled, can run using console in directory ../../build/classes/ by invoking \
+     *      java -classpath . TcpExamples.TcpExample3Server
+     * @param args command-line arguments
+     */
+    public static void main(String[] args) {
+        try {
+            
+            // ServerSocket waits for a connection from a client. 
+            // Notice that it is outside the loop; ServerSocket
+            // needs to be made only once.
+            System.out.println(Assignmnet1TCPExample3ServerChange.class.getName() + " has started..."); // it helps debugging to put this on console first
+            
+            ServerSocket serverSocket = new ServerSocket(2317);
+            OutputStream os;
+            PrintStream ps;
+            InetAddress localAddress, remoteAddress;
+            int localPort, remotePort;
+            int serverLoopCount = 0;
+
+            // Server is up and waiting (i.e. "blocked" or paused)
+            // Loop, infinitely, waiting for client connections.
+            // Stop the program somewhere else.
+            while (true) { 
+                
+                // block until connected to a client
+                try (Socket clientConnectionSocket = serverSocket.accept())
+                {
+                    serverLoopCount++; // increment at beginning of loop for reliability
+                    
+                    // Now hook everything up (i.e. set up the streams), Java style:
+                    os = clientConnectionSocket.getOutputStream();
+                    ps = new PrintStream(os);
+                    ps.println("This is response " + serverLoopCount + " produced by the server, " 
+                            + Assignmnet1TCPExample3ServerChange.class.getName()); // this gets sent back to client!
+                    
+                    // Print some information locally about the Socket connection.
+                    // This includes the port and IP numbers on both sides (the socket pair).
+                     localAddress = clientConnectionSocket.getLocalAddress();
+                    remoteAddress = clientConnectionSocket.getInetAddress();
+                        localPort = clientConnectionSocket.getLocalPort();
+                       remotePort = clientConnectionSocket.getPort();
+                       
+                    System.out.print ("Server loop " + serverLoopCount + ": ");
+                    
+                    // My socket pair connection looks like this, to localhost:
+                    // Socket pair: (( /0:0:0:0:0:0:0:1, 2317 ), ( /0:0:0:0:0:0:0:1, 54876 ))
+                    // Socket pair: (( /0:0:0:0:0:0:0:1, 2317 ), ( /0:0:0:0:0:0:0:1, 54881 ))
+                    
+                    // Why is the first IP/port the same, while the second set has different ports?
+                    System.out.println(TcpExample3Server.class.getName() + " socket pair showing host name, address, port:");
+                    System.out.println("  (( " + 
+                         localAddress.getHostName() + "=" +  localAddress.getHostAddress() + ", " + localPort + " ), ( " + 
+                        remoteAddress.getHostName() + "=" + remoteAddress.getHostAddress() + ", " + remotePort + " ))");
+                    
+                    if ( localAddress.getHostName().equals( localAddress.getHostAddress()) ||
+                        remoteAddress.getHostName().equals(remoteAddress.getHostAddress()))
+                        System.out.println("  note HostName matches address if host has no DNS name");
+                    
+                    // Notice the use of flush() and try w/ resources. Without
+                    // the try w/ resources the Socket object may stay open for
+                    // a while after the client has stopped needing this
+                    // connection. try w/ resources explicitly ends the connection.
+                    ps.flush();
+                    // like it or not, you're outta here!
+                }
+            }
+        } catch (IOException e) {
+            System.err.println("Problem with " + TcpExample3Server.class.getName() + " networking: " + e);
+
+            // Provide more helpful information to user if exception occurs due to running twice at one time
+            if (e instanceof java.net.BindException) {
+                System.err.println("*** Be sure to stop any other running instances of programs using this port!");
+            }
+        }
+    }
+}
diff --git a/examples/src/TcpExamples/TcpExample1Telnet.java b/examples/src/TcpExamples/TcpExample1Telnet.java
index e969b7958c..08c4c68f29 100644
--- a/examples/src/TcpExamples/TcpExample1Telnet.java
+++ b/examples/src/TcpExamples/TcpExample1Telnet.java
@@ -32,6 +32,11 @@ import java.net.*;
  */
 public class TcpExample1Telnet 
 {
+    /** Default constructor */
+    public TcpExample1Telnet()
+    {
+        // default constructor
+    }
     /**
      * Program invocation, execution starts here
      * @param args command-line arguments
diff --git a/examples/src/TcpExamples/TcpExample2ConnectionCounting.java b/examples/src/TcpExamples/TcpExample2ConnectionCounting.java
index c1b62609c7..ba97fd802e 100644
--- a/examples/src/TcpExamples/TcpExample2ConnectionCounting.java
+++ b/examples/src/TcpExamples/TcpExample2ConnectionCounting.java
@@ -23,6 +23,11 @@ import java.net.*;
  */
 public class TcpExample2ConnectionCounting 
 {
+    /** Default constructor */
+    public TcpExample2ConnectionCounting()
+    {
+        // default constructor
+    }
     /**
      * Program invocation, execution starts here
      * @param args command-line arguments
diff --git a/examples/src/TcpExamples/TcpExample3Client.java b/examples/src/TcpExamples/TcpExample3Client.java
index f5f7e1c5a8..1986e2b6d5 100644
--- a/examples/src/TcpExamples/TcpExample3Client.java
+++ b/examples/src/TcpExamples/TcpExample3Client.java
@@ -14,7 +14,13 @@ import java.net.*;
  * @author mcgredo
  * @author brutzman
  */
-public class TcpExample3Client {
+public class TcpExample3Client
+{
+    /** Default constructor */
+    public TcpExample3Client()
+    {
+        // default constructor
+    }
 
     /** IPv6 String constant for localhost address, similarly IPv4 127.0.0.1
      * @see <a href="https://en.wikipedia.org/wiki/localhost">https://en.wikipedia.org/wiki/localhost</a>
diff --git a/examples/src/TcpExamples/TcpExample3Server.java b/examples/src/TcpExamples/TcpExample3Server.java
index 7d5439e1bb..f0901a466b 100644
--- a/examples/src/TcpExamples/TcpExample3Server.java
+++ b/examples/src/TcpExamples/TcpExample3Server.java
@@ -22,7 +22,13 @@ import java.net.*;
  * @author mcgredo
  * @author brutzman
  */
-public class TcpExample3Server {
+public class TcpExample3Server
+{
+    /** Default constructor */
+    public TcpExample3Server()
+    {
+        // default constructor
+    }
 
     /**
      * Program invocation, execution starts here
diff --git a/examples/src/TcpExamples/TcpExample4Client.java b/examples/src/TcpExamples/TcpExample4Client.java
index f7bea7cc27..a1a891b8f7 100644
--- a/examples/src/TcpExamples/TcpExample4Client.java
+++ b/examples/src/TcpExamples/TcpExample4Client.java
@@ -14,6 +14,11 @@ import java.net.*;
  */
 public class TcpExample4Client
 {
+    /** Default constructor */
+    public TcpExample4Client()
+    {
+        // default constructor
+    }
     static String DESTINATION_HOST = "localhost";
     static int    MAX_LOOP_COUNT   = 4;
 
diff --git a/examples/src/TcpExamples/TcpExample4DispatchServer.java b/examples/src/TcpExamples/TcpExample4DispatchServer.java
index e5e2df5efd..5c0b4ba725 100644
--- a/examples/src/TcpExamples/TcpExample4DispatchServer.java
+++ b/examples/src/TcpExamples/TcpExample4DispatchServer.java
@@ -11,8 +11,13 @@ import java.net.*;
  * @author Don Brutzman
  * @author MV3500 class
  */
-public class TcpExample4DispatchServer {
-
+public class TcpExample4DispatchServer
+{
+    /** Default constructor */
+    public TcpExample4DispatchServer()
+    {
+        // default constructor
+    }
     /**
      * Program invocation, execution starts here
      * @param args command-line arguments
diff --git a/examples/src/UdpExamples/MulticastUdpReceiver.java b/examples/src/UdpExamples/MulticastUdpReceiver.java
index 3f72d6d2d4..21e66d1d99 100644
--- a/examples/src/UdpExamples/MulticastUdpReceiver.java
+++ b/examples/src/UdpExamples/MulticastUdpReceiver.java
@@ -13,8 +13,13 @@ import java.util.logging.Logger;
  * @author mcgredo
  * @author brutzman
  */
-public class MulticastUdpReceiver {
-
+public class MulticastUdpReceiver
+{
+    /** Default constructor */
+    public MulticastUdpReceiver()
+    {
+        // default constructor
+    }
     // reserved range for all IPv4 multicast: 224.0.0.0 through 239.255.255.255
     // https://en.wikipedia.org/wiki/Multicast_address
     // https://www.iana.org/assignments/multicast-addresses/multicast-addresses.xhtml
diff --git a/examples/src/UdpExamples/MulticastUdpSender.java b/examples/src/UdpExamples/MulticastUdpSender.java
index 756a141d7b..56d1d94a66 100644
--- a/examples/src/UdpExamples/MulticastUdpSender.java
+++ b/examples/src/UdpExamples/MulticastUdpSender.java
@@ -16,6 +16,11 @@ import java.util.logging.Logger;
  */
 public class MulticastUdpSender
 {
+    /** Default constructor */
+    public MulticastUdpSender()
+    {
+        // default constructor
+    }
     // reserved range for all IPv4 multicast: 224.0.0.0 through 239.255.255.255
     // https://www.iana.org/assignments/multicast-addresses/multicast-addresses.xhtml
 
diff --git a/examples/src/UdpExamples/UnicastUdpReceiver.java b/examples/src/UdpExamples/UnicastUdpReceiver.java
index bb5e018fea..5317a5b75d 100644
--- a/examples/src/UdpExamples/UnicastUdpReceiver.java
+++ b/examples/src/UdpExamples/UnicastUdpReceiver.java
@@ -16,8 +16,13 @@ import java.net.*;
  * @author mcgredo
  * @author brutzman
  */
-public class UnicastUdpReceiver 
+public class UnicastUdpReceiver
 {
+    /** Default constructor */
+    public UnicastUdpReceiver()
+    {
+        // default constructor
+    }
 //  public static final int        SENDING_PORT = 1414;        // port used by UdpSender, unneeded here
     /** socket value of shared interest */
     public static final int      UDP_PORT = 1415;        // sharable
diff --git a/examples/src/UdpExamples/UnicastUdpSender.java b/examples/src/UdpExamples/UnicastUdpSender.java
index 246375aebe..f6b44037b7 100644
--- a/examples/src/UdpExamples/UnicastUdpSender.java
+++ b/examples/src/UdpExamples/UnicastUdpSender.java
@@ -19,6 +19,11 @@ import java.net.*;
  */
 public class UnicastUdpSender 
 {
+    /** Default constructor */
+    public UnicastUdpSender()
+    {
+        // default constructor
+    }
     private static final String            MY_NAME = System.getProperty("user.name"); // guru incantation   8)
 //  public  static final int          SENDING_PORT = 1414; // not needed, can let system choose an open local port
     /** socket value of shared interest */
-- 
GitLab