Stack Exchange network consists of 177 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Network Engineering Stack Exchange is a question and answer site for network engineers. It only takes a minute to sign up.
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
With TCP you listen to some port (say port 80) and then when an incoming connection pops up, you accept it, establishing the connection over a new port.
Why is this necessary? Why can't you just keep communicating over the original port?
The incoming connection is accepted and the socket uses the listening port on the server, not an another one. Some protocols are more complicated than that but HTTP (from your question's port 80) isn't.
Required, but never shown