Question

My question is very simple and straight to the point. In my readings, is it okay to say that the port 80 on a web server is a passive socket that simply creates an active socket for every connection?

Was it helpful?

Solution

Server is a passive listener (listening on a specific port), and will create a new socket when accept a new connection with unreserved port number.

For example web server (TCP server)

Listen on port 80 and accept many connections on different ports (e.g has 5 accepted sockets on port 5001, 5002, 5003, 5004, 5005)

OTHER TIPS

Is it okay to say that the port 80 on a web server is a passive socket

It is a passive port. It is represented inside the web server process by a socket.

that simply creates an active socket for every connection?

Ports don't create sockets. TCP creates sockets. The web server process accepts a connection and this is delivered to the process in the form of an active socket.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top