摘要:
返回值为n1.n>0,正常读取n个字节2.n==0,socket对方节点正常shutdown3.n==-1,未能正常读取数据,有以下几种情况,errno被置为以下几种:EAGAIN or EWOULDBLOCK The socket is marked nonblocking and the receive operation would block, or a receive timeout had been set and the timeout expired before data was received.这种情况要注意,前者是非阻塞方式下的一种正常返回,后者是超时的返回情况。 阅读全文