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

Frank Assignment 2

parent 468ed350
No related branches found
No related tags found
No related merge requests found
......@@ -28,6 +28,10 @@ public class FrankServer {
InetAddress localAddress, remoteAddress;
int localPort, remotePort;
int serverLoopCount = 0;
InputStream is;
InputStreamReader isr;
BufferedReader br;
String clientMessage;
// Server is up and waiting (i.e. "blocked" or paused)
// Loop, infinitely, waiting for client connections.
......@@ -69,7 +73,11 @@ public class FrankServer {
|| remoteAddress.getHostName().equals(remoteAddress.getHostAddress())) {
System.out.println(" note HostName matches address if host has no DNS name");
}
is = clientConnectionSocket.getInputStream();
isr = new InputStreamReader(is);
br = new BufferedReader(isr);
clientMessage = br.readLine();
System.out.println("The message the client sent was: '" + clientMessage + "'");// Displaying the message the client sent
// Not/*i*/ce 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
......
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