在Linux上发送异步套接字

cha*_*med 1 c++ sockets linux asynchronous send

当在异步套接字上发送返回EAGAIN时,这是否意味着:当前调用刚刚成功排队或由于系统仍在处理先前的发送而没有做任何事情?

先感谢您.

mav*_*rik 6

来自man 2 send:

套接字标记为非阻塞,请求的操作将被阻止.POSIX.1-2001允许在这种情况下返回错误,并且不要求此常量[EAGAIN EWOULDBLOCK]具有相同的值,因此便携式应用程序应检查两种可能性.

所以,我认为EAGAIN意味着:be careful, the message did not fit into send buffer, this call would be blocked in normal (blocking) mode. Use select(2) to determine whether you can send more data.

PS实际上,看起来呼叫失败了,什么都没做.