From a3bd75031e95a4c8711f82a42f6dce075398d989 Mon Sep 17 00:00:00 2001 From: brutzman <brutzman@nps.edu> Date: Sat, 24 Jul 2021 14:55:45 -0700 Subject: [PATCH] further guidance on stopping processes --- .../TcpExamples/TcpExample3TerminalLog.txt | 90 ++++++++++--------- 1 file changed, 46 insertions(+), 44 deletions(-) diff --git a/examples/src/TcpExamples/TcpExample3TerminalLog.txt b/examples/src/TcpExamples/TcpExample3TerminalLog.txt index e605f2b166..e6b55d9562 100644 --- a/examples/src/TcpExamples/TcpExample3TerminalLog.txt +++ b/examples/src/TcpExamples/TcpExample3TerminalLog.txt @@ -1,44 +1,46 @@ -Invocation instructions: -* run/debug TcpExample3Server.java -* run/debug TcpExample3Client.java - -Program responses: - -=================================================== -run-single: -TcpExample3Server has started... -Server loop 1: TcpExample3Server socket pair showing host name, address, port: - (( 0:0:0:0:0:0:0:1=0:0:0:0:0:0:0:1, 2317 ), ( 0:0:0:0:0:0:0:1=0:0:0:0:0:0:0:1, 54180 )) - note HostName matches address if host has no DNS name -Server loop 2: TcpExample3Server socket pair showing host name, address, port: - (( 0:0:0:0:0:0:0:1=0:0:0:0:0:0:0:1, 2317 ), ( 0:0:0:0:0:0:0:1=0:0:0:0:0:0:0:1, 54181 )) - note HostName matches address if host has no DNS name -Server loop 3: TcpExample3Server socket pair showing host name, address, port: - (( 0:0:0:0:0:0:0:1=0:0:0:0:0:0:0:1, 2317 ), ( 0:0:0:0:0:0:0:1=0:0:0:0:0:0:0:1, 54182 )) - note HostName matches address if host has no DNS name -[etc.] -[kill process to exit] - -=================================================== -run-single: -TcpExample3Client creating socket... -================================================== -Client loop 1: now we're talking! -The message the server sent was: 'This is response 1 produced by the server.' -TcpExample3Client creating socket... -================================================== -Client loop 2: now we're talking! -The message the server sent was: 'This is response 2 produced by the server.' -TcpExample3Client creating socket... -================================================== -Client loop 3: now we're talking! -The message the server sent was: 'This is response 3 produced by the server.' -TcpExample3Client creating socket... -================================================== -[etc.] -TcpExample3Client exit - -You must kill this process to get it to stop, each is in an infinite loop. - -If you kill the server, that will kill the client automatically when the -connection drops, because the client software program was written that way. +Invocation instructions: +* run/debug TcpExample3Server.java +* run/debug TcpExample3Client.java + +Program responses: + +=================================================== +run-single: +TcpExample3Server has started... +Server loop 1: TcpExample3Server socket pair showing host name, address, port: + (( 0:0:0:0:0:0:0:1=0:0:0:0:0:0:0:1, 2317 ), ( 0:0:0:0:0:0:0:1=0:0:0:0:0:0:0:1, 54180 )) + note HostName matches address if host has no DNS name +Server loop 2: TcpExample3Server socket pair showing host name, address, port: + (( 0:0:0:0:0:0:0:1=0:0:0:0:0:0:0:1, 2317 ), ( 0:0:0:0:0:0:0:1=0:0:0:0:0:0:0:1, 54181 )) + note HostName matches address if host has no DNS name +Server loop 3: TcpExample3Server socket pair showing host name, address, port: + (( 0:0:0:0:0:0:0:1=0:0:0:0:0:0:0:1, 2317 ), ( 0:0:0:0:0:0:0:1=0:0:0:0:0:0:0:1, 54182 )) + note HostName matches address if host has no DNS name +[etc.] +[kill process to exit] + +=================================================== +run-single: +TcpExample3Client creating socket... +================================================== +Client loop 1: now we're talking! +The message the server sent was: 'This is response 1 produced by the server.' +TcpExample3Client creating socket... +================================================== +Client loop 2: now we're talking! +The message the server sent was: 'This is response 2 produced by the server.' +TcpExample3Client creating socket... +================================================== +Client loop 3: now we're talking! +The message the server sent was: 'This is response 3 produced by the server.' +TcpExample3Client creating socket... +================================================== +[etc.] +TcpExample3Client exit + +You must kill this client process to stop it, each is in an infinite loop. + +If first you kill the server process, that will kill the client process +automatically when the connection drops, simply because the client program +is written that way. Killing the client process first does not stop the +server, which will keep the localhost port locked. Go ahead and test this. -- GitLab