linux—I/O多路轉接之select

【I/O多路轉接】 從 socket 中讀取數據可以使用如下的代碼: while( (n = read(socketfd, buf, BUFSIZE) ) >0) if( write(STDOUT_FILENO, buf, n) = n) { printf(「write error」); exit(1); } 當代碼中的socketfd描述符所對應的文件表項是處於阻塞時,它會一直阻塞,直到有數據從
相關文章
相關標籤/搜索