這個函式非常類似 select(),它們兩者都監看整組 file descriptor 的事件,比如進入的資料是就緒可收[ready to recv()]、socket 是就緒可送[ready to send()] 資料、out-of-band 資料是就緒可收[ready to recv()]、錯誤等。
struct pollfd {int fd;// the socket descriptorshort events;// bitmap of events we're interested inshort revents;// when poll() returns, bitmap of events that occurred};