On Linux, how does select () determine when a TCP / IP connection can be written without blocking?

From the man page for select ():

in writefds will be observed whether the record will block

For a file descriptor associated with a TCP / IP connection, how does the select () function determine when a connection can be written without blocking? An alternative way to formulate my question would also be, what are the conditions when select () returns, indicating that the file descriptor can be written without blocking?

I would suggest that select () will not return fd to fd_set if the send buffer is full. If true, is this the only consideration? I can present many possible criteria for determining whether a record should be blocked or not, so I am interested to know how it works on Linux.

+4
source share
2 answers

It will indicate that FD is writable when there is space in the send buffer. There are no other considerations.

When connecting, this includes the case when the connection is completed, since the send buffer is effectively distributed at this time.

+5
source

, , . ​​ . (UDP) , , (TCP). , , . , . , , .

+1

All Articles