Understanding Client Server Connections

2019-04-14 12:32发布

问题:

I have been reading and trying to understand about connection made between client and server. Found many articles but they all left me into some virtual world. I am asking this question to validate my understanding.

So each client and server connection is actually server socket dedicated to the client.

For clarity I am taking example of java server, lets say Tomcat. -

  1. If each new client request open's a new socket at server machine and starts a new thread of server to continue the communication ?(Yes/No)

  2. From #1 does this mean that max. no. connections that could be made to server depends upon the no. of threads server can support ?(Yes/No)

  3. Socket is a pair of IP:PORT, does this mean for each new connection a new port is used ?(Yes/No)

  4. How server manages these ports allocation for creating new socket for new connection ?

  5. Does scaling a single server machine on fleet means increasing these connection threads ?(Yes/No/Needs More explanation)

  6. Are these threads system-level threads(not the JVM threads), as they are using system resources ?(Yes/No)