Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
NetworkedGraphicsMV3500
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Savage
NetworkedGraphicsMV3500
Commits
8368d40c
Commit
8368d40c
authored
3 years ago
by
justi
Browse files
Options
Downloads
Patches
Plain Diff
Frank Assignment 2
parent
468ed350
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
assignments/src/MV3500Cohort2021JulySeptember/homework2/Frank/FrankServer.java
+9
-1
9 additions, 1 deletion
...0Cohort2021JulySeptember/homework2/Frank/FrankServer.java
with
9 additions
and
1 deletion
assignments/src/MV3500Cohort2021JulySeptember/homework2/Frank/FrankServer.java
+
9
−
1
View file @
8368d40c
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment