1. windows平台上无论利用socket()函数还是WSASocket()函数创建的socket都是阻塞模式的: SOCKET WSAAPI socket( _In_ int af, _In_ int type, _In_ int protocol ); SOCKET WSASocket( _In_ int af, _In_ int type, _In_ int protocol, _In_ LPWSAPROTOCOL_INFO lpProtocolInfo, _In_ GROUP g,…
/* * "Timed" read - timout specifies the # of seconds to wait before * giving up (5th argument to select controls how long to wait for * data to be readable). Returns # of bytes read or -1 on error. * * LOCKING: none. */ ssize_t tread(int fd, vo…