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
e48a9e0f
Commit
e48a9e0f
authored
3 years ago
by
KReynolds
Browse files
Options
Downloads
Patches
Plain Diff
Customized Homework1 to make it unique.
parent
c8032ad1
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/homework1/ReynoldsTcpExample1Telnet1.java
+14
-5
14 additions, 5 deletions
...21JulySeptember/homework1/ReynoldsTcpExample1Telnet1.java
with
14 additions
and
5 deletions
assignments/src/MV3500Cohort2021JulySeptember/homework1/ReynoldsTcpExample1Telnet1.java
+
14
−
5
View file @
e48a9e0f
...
@@ -23,7 +23,7 @@ public class ReynoldsTcpExample1Telnet1
...
@@ -23,7 +23,7 @@ public class ReynoldsTcpExample1Telnet1
{
{
System
.
out
.
println
(
"TcpExample1Telnet has started and is waiting for a connection."
);
System
.
out
.
println
(
"TcpExample1Telnet has started and is waiting for a connection."
);
System
.
out
.
println
(
" help: https://savage.nps.edu/Savage/developers.html#telnet"
);
System
.
out
.
println
(
" help: https://savage.nps.edu/Savage/developers.html#telnet"
);
System
.
out
.
println
(
" enter (telnet localhost 2317) or (nc localhost 2317)..."
);
System
.
out
.
println
(
" enter (telnet localhost 2317) or (nc localhost 2317)...
\n
"
);
// The ServerSocket waits for a connection from a client.
// The ServerSocket waits for a connection from a client.
// It returns a Socket object when the connection occurs.
// It returns a Socket object when the connection occurs.
...
@@ -40,10 +40,19 @@ public class ReynoldsTcpExample1Telnet1
...
@@ -40,10 +40,19 @@ public class ReynoldsTcpExample1Telnet1
OutputStream
os
=
clientConnection
.
getOutputStream
();
OutputStream
os
=
clientConnection
.
getOutputStream
();
PrintStream
ps
=
new
PrintStream
(
os
);
PrintStream
ps
=
new
PrintStream
(
os
);
ps
.
println
(
"Client response was brought to you by the Domo"
);
// to remote clientnc
ps
.
println
(
"Initiating Client-side handshake... \n"
);
// to remote clientnc
ps
.
println
(
"DomsaMom"
);
ps
.
println
(
"Requesting authentication..."
);
System
.
out
.
println
(
"Client response was brought to you by the Domo"
);
// to server console
ps
.
println
(
"Authentication granted \n"
);
System
.
out
.
println
(
"DomsaMom"
);
ps
.
println
(
"Secret message sent to host \n"
);
ps
.
println
(
"Disconnecting from host..."
);
System
.
out
.
println
(
"Conducting server-side handshake..."
);
// to server console
System
.
out
.
println
(
"Granting authentication \n"
);
System
.
out
.
println
(
"Secret message recieved from client..."
);
System
.
out
.
println
(
"Client sent 'hello' message \n"
);
System
.
out
.
println
(
"Disconnecting connection to client... \n"
);
// "flush()" in important in that it forces a write
// "flush()" in important in that it forces a write
// across what is in fact a slow connection
// across what is in fact a slow connection
...
...
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