Does “Listening” a port means a continuous polling to that port or a discrete polling or an interrupt driven process.
What exactly is going on in “Listening to a Port”?
Does Listening a port means a continuous polling to that port or a discrete
Share
A port is nothing more than a concept, it’s not like if you could check some memory bits, waiting for some information.
So, listening to a port will teach the kernel what to do upon receiving packets with this specific port number: transmit it to the process which asked to listen on that port, instead of replying [or not] that the port in not open.
NB: that’s just speculations, I didn’t investigate any kernel implementation.
EDIT: On the process side,
listenwill tell the kernel that you’re interested in a particular rendez-vous portlistenandaccept, either the kernel buffers the new connections or rejects them untilaccepthas been called, please refer to the relevant manual)acceptwill bind the connection to a communication port, and start buffering the incoming packetsrecv(orpollorselectcertainly) will pickup data from the reception buffer