I've been reading about TCP Client/Server communication and I can't find a good description of how multiple Sockets listen to the same port.
I read this,
TCP : two different sockets sharing a port?
and I understand that as long as a Socket can be uniquely identified, then the two Sockets can listen to the same port.
When the server sees a new incoming connection, it branches/forks a new Socket to handle that new connection.
My question is, since the remote client is still sending messages to the same SERVER port (80 in many cases), how does the Server know to which Socket (of the two+ sockets listening to SERVER port 80) the messages should be sent?
My suspicion is that there is some Socket that is a sort of "Dispatcher" that does all the listening dirty work, and distributes incoming messages to the correct Socket.
My suspicion is reinforced by this question,
but the answer to that question seems really indefinite. Additionally, the top answer here
How does webserver handle multiple connections on the same port
seems to imply that my suspicion is correct, but I don't want to make any assumptions.
Please clear up any misconceptions I have, I only recently started studying networking.