Skip to content
Snippets Groups Projects
Commit b4d196e2 authored by justi's avatar justi
Browse files

Frank Assignment 2

parent f10b0e4f
No related branches found
No related tags found
No related merge requests found
...@@ -15,7 +15,12 @@ import java.net.Socket; ...@@ -15,7 +15,12 @@ import java.net.Socket;
* and open the template in the editor. * and open the template in the editor.
*/ */
/** /**
* *This is assignment 2 were I modified TCP example 3
* If server message is = "this is good bye message from Franks server" the client terminates
* Changed the local host 2318
* Changed the sleep to 1 second
* Received a message from the server "How are you doing"
* Client sends a message to the server " I'm doing well"
* @author justi * @author justi
*/ */
public class FrankClient { public class FrankClient {
...@@ -26,7 +31,7 @@ public class FrankClient { ...@@ -26,7 +31,7 @@ public class FrankClient {
/** /**
* Program invocation, execution starts here * Program invocation, execution starts here
* * If client receives m
* @param args command-line arguments * @param args command-line arguments
* @throws java.lang.InterruptedException user cancels execution * @throws java.lang.InterruptedException user cancels execution
*/ */
......
...@@ -4,16 +4,19 @@ import java.io.*; ...@@ -4,16 +4,19 @@ import java.io.*;
import java.net.*; import java.net.*;
/**
*This is assignment 2 were I modified TCP example 3
* I set sever loop count <= 10 and terminates after 10 loops
* sends a message to the client ""this is good bye message from Franks server"
* Sent a message to client "How are you doing"
* Recieves a message from the client "I'm doing well"
* @author justi
*/
public class FrankServer { public class FrankServer {
/**
* 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
* @throws java.lang.InterruptedException user cancels execution
*/
public static void main(String[] args) throws InterruptedException { public static void main(String[] args) throws InterruptedException {
try { try {
...@@ -48,7 +51,7 @@ public class FrankServer { ...@@ -48,7 +51,7 @@ public class FrankServer {
if (serverLoopCount <= 10) { // checking if the loop count <= 10 if (serverLoopCount <= 10) { // checking if the loop count <= 10
ps.println("How are you doing?"); // this gets sent back to client! ps.println("How are you doing?"); // this gets sent back to client!
} else { } else {
ps.println("this is good bye message from Franks server"); // termination after 20 messages ps.println("this is good bye message from Franks server"); // termination after 10 messages
break; // Stop server break; // Stop server
} }
// Print some information locally about the Socket connection. // Print some information locally about the Socket connection.
......
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