문제

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?

도움이 되었습니까?

해결책

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)

다른 팁

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top