Search code examples
socketsports

Is port 80 on a web server a passive socket?


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?


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)