CSC209H1 Lecture Notes - File Descriptor
Document Summary
There is data in the receive buffer to be read. The socket is a listening socket and there is a connection pending. A socket error is pending: ready to write when. There is space available in the write buffer. A socket error is pending: exceptino condition pending when. Tcp out-of-band data: we are typically interested in when bytes are available to be read, but sometimes we use select on write or exception sets. Select() timeout: the timeout specifies how long we"re willing to wait for a fd to become ready struct timeval { long tv_sec; / seconds long tv_usec; / microseconds. If timeout is null, wait forever (or until we catch a signal) If timeout is zero, test and return immediately. Otherwise wait up to specified timeout: select() returns when a fd ready or we timeout.