Speaking in high-level terms, suppose I have a server that capitalizes whatever strings it receives on the port it is listening to, and then returns them. It is on the same physical machine as the applications sending/reading the strings. For definiteness, we're on Linux or Windows. Would the following correctly describe the situation?
Our server interacts with two connections. The first is a connection from the application sending the string from localhost:port1
, and the server is listening on localhost:port2
. Then, after processing, it sends the capitalized string from localhost:port3
to an application listening on localhost:port4
that can read the packet.
So we have: localhost:port1 -(lowercase string)-> localhost:port2
; then localhost:port3 -(uppercase string)-> localhost:port4
.
Would this be an accurate portrait of how our server would interact with the machine's ports? In particular, must port1
through port4
be actually distinct ports?