|
2) That is interesting! I always thought that the kernel waited for the accept() to establish a connection. Just goes to show that I don't know everything.
5) The port has an open socket associated with it. And the kernel know which port goes to which socket. The TCP/IP code has the job of making the data available to the socket.
6) If the process is using O-NONBLOCK (or equivalent) as yours is, the kernel does nothing. The hope is that the process will eventually decide to issue the accept() or the read() or whatever. If the process has blocked waiting for for data on the socket, it will be "awoken" when data arrives. This will put it on the run queue. And when a cpu runs it, the system call will finally complete.
|