This is a prototype of the select statement (in man pages):
int select(int n, fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
struct timeval *timeout);
I know what to use the readfds parameter for: with this you can see if the data has been written to one of your sockets. On the other hand, the writefds page I found says that it means "if any of the sockets is ready to send () data to." But what does this mean? Windows Sockets Network Programming by Quin and Shute says this detects either a connected or a writable state. What is the point? It is simple to check if the socket still has a connection to the connected client and checks if there is anything using something in this socket?
So: what are writefds commonly used for?
source
share