From a0674bed63078aec8fc3010c5cd662405e250d76 Mon Sep 17 00:00:00 2001 From: brutzman <brutzman@nps.edu> Date: Sat, 24 Jul 2021 14:49:11 -0700 Subject: [PATCH] sleep delay, warning --- examples/src/TcpExamples/TcpExample3Client.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/examples/src/TcpExamples/TcpExample3Client.java b/examples/src/TcpExamples/TcpExample3Client.java index bc7baabc40..86dde95e2f 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) { -- GitLab