diff --git a/examples/src/TcpExamples/TcpExample3Client.java b/examples/src/TcpExamples/TcpExample3Client.java index bc7baabc400a93d84490993dca579e1bbefe274b..86dde95e2fe549741736854eadaee4bac5e890c1 100644 --- a/examples/src/TcpExamples/TcpExample3Client.java +++ b/examples/src/TcpExamples/TcpExample3Client.java @@ -25,7 +25,7 @@ public class TcpExample3Client { * Program invocation, execution starts here * @param args command-line arguments */ - public static void main(String[] args) { + public static void main(String[] args) throws InterruptedException { // Local variables/fields Socket socket = null; @@ -64,7 +64,9 @@ public class TcpExample3Client { System.out.println("The message the server sent was: '" + serverMessage + "'"); // socket gets closed, either automatically/silently by this code (or possibly by the server) - } // end while(true) + Thread.sleep(500l); // slow things down, for example 500l (long) = 500 msec + + } // end while(true) // infinite loops are dangerous, be sure to kill this process! } catch (IOException e) {