Skip to content
Snippets Groups Projects
Commit e6d3f160 authored by owner's avatar owner
Browse files

Homework 2

parent 9516e70a
No related branches found
No related tags found
No related merge requests found
...@@ -9,12 +9,12 @@ import java.util.Scanner; ...@@ -9,12 +9,12 @@ import java.util.Scanner;
//import java.time.LocalTime; // conversion? //import java.time.LocalTime; // conversion?
/** /**
* This client program establishes a socket connection to the {@link TcpExample4DispatchServer}, * This client program establishes a socket connection to the {@link LennonHW2DispatchServer},
* then checks how long it takes to read the single line it expects as a server response. * then plays a random number guessing game.
* No fancy footwork here, it is pretty simple and similar to {@link TcpExample3Client}. * No fancy footwork here, it is pretty simple and similar to {@link TcpExample3Client}.
* *
* @see TcpExample4DispatchServer * see TcpExample4DispatchServer
* @see TcpExample4HandlerThread * see TcpExample4HandlerThread
* *
* @see <a href="../../../src/TcpExamples/TcpExample4TerminalLog.txt" target="blank">TcpExample4TerminalLog.txt</a> * @see <a href="../../../src/TcpExamples/TcpExample4TerminalLog.txt" target="blank">TcpExample4TerminalLog.txt</a>
* @see <a href="../../../src/TcpExamples/TcpExample4SequenceDiagram.png" target="blank">TcpExample4SequenceDiagram.png</a> * @see <a href="../../../src/TcpExamples/TcpExample4SequenceDiagram.png" target="blank">TcpExample4SequenceDiagram.png</a>
......
...@@ -8,7 +8,7 @@ import java.net.*; ...@@ -8,7 +8,7 @@ import java.net.*;
* new thread to handle multiple incoming socket connections, one after another, all running in parallel. * new thread to handle multiple incoming socket connections, one after another, all running in parallel.
* This advanced technique is often used in high=performance high=capacity server programs. * This advanced technique is often used in high=performance high=capacity server programs.
* *
* @see TcpExample4Client * @see LennonHW2Client
* @see LennonHW2HandlerThread * @see LennonHW2HandlerThread
* *
* @see <a href="../../../src/TcpExamples/TcpExample4TerminalLog.txt" target="blank">TcpExample4TerminalLog.txt</a> * @see <a href="../../../src/TcpExamples/TcpExample4TerminalLog.txt" target="blank">TcpExample4TerminalLog.txt</a>
......
...@@ -8,7 +8,7 @@ import java.util.Random; ...@@ -8,7 +8,7 @@ import java.util.Random;
/** /**
* <p> * <p>
* This utility class supports the {@link TcpExample4DispatchServer} program, * This utility class supports the {@link LennonHW2DispatchServer} program,
* handling all programming logic needed for a new socket connection * handling all programming logic needed for a new socket connection
* to run in a thread of its own. This is the server * to run in a thread of its own. This is the server
* portion as well, so we artificially invent what happens * portion as well, so we artificially invent what happens
...@@ -18,8 +18,8 @@ import java.util.Random; ...@@ -18,8 +18,8 @@ import java.util.Random;
* Warning: do not run this class! It is created and used automatically by {@link TcpExample4DispatchServer} at run time. * Warning: do not run this class! It is created and used automatically by {@link TcpExample4DispatchServer} at run time.
* </p> * </p>
* *
* @see TcpExample4Client * see TcpExample4Client
* @see TcpExample4DispatchServer * see TcpExample4DispatchServer
* *
* @see <a href="../../../src/TcpExamples/TcpExample4TerminalLog.txt" target="blank">TcpExample4TerminalLog.txt</a> * @see <a href="../../../src/TcpExamples/TcpExample4TerminalLog.txt" target="blank">TcpExample4TerminalLog.txt</a>
* @see <a href="../../../src/TcpExamples/TcpExample4SequenceDiagram.png" target="blank">TcpExample4SequenceDiagram.png</a> * @see <a href="../../../src/TcpExamples/TcpExample4SequenceDiagram.png" target="blank">TcpExample4SequenceDiagram.png</a>
...@@ -56,7 +56,7 @@ public class LennonHW2HandlerThread extends Thread ...@@ -56,7 +56,7 @@ public class LennonHW2HandlerThread extends Thread
/** Handles one connection. We add an artificial slowness /** Handles one connection. We add an artificial slowness
* to handling the connection with a sleep(). This means * to handling the connection with a sleep(). This means
* the client won't see a server connection response for ten seconds (default). * the client won't see a server connection response for 0.5 seconds.
*/ */
// @overriding run() method in Java Thread class is deliberate // @overriding run() method in Java Thread class is deliberate
@Override @Override
......
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