哪些原因会导致袜子上发送“资源暂时不可用”()命令 [英] What can cause a “Resource temporarily unavailable” on sock send() command
问题描述
什么能插座发送()
命令上引起资源暂时不可用
错误?这个插座设置为 AF_UNIX,SOCK_STREAM
。它的工作原理的大部分时间,但偶尔得到这个错误。插座的接收端似乎正常工作。
What can cause a Resource temporarily unavailable
error on a socket send()
command? The socket is setup as AF_UNIX, SOCK_STREAM
. It works most of the time, but occasionally gets this error. The receiving end of the socket appears to be working properly.
我知道这是不是很详细,但我只是在寻找总体思路。谢谢!
I know this isn't very detailed, but I'm just looking for general ideas. Thanks!
推荐答案
资源暂时不可用
是对应于该错误信息 EAGAIN
,这意味着操作会阻止,但被要求非阻塞操作。对于发送()
,这可能是由于任何的:
"Resource temporarily unavailable"
is the error message corresponding to EAGAIN
, which means that the operation would have blocked but nonblocking operation was requested. For send()
, that could be due to any of:
- 标记明确的文件描述符为非阻塞与
的fcntl()
;或 - 通过了
MSG_DONTWAIT
标志发送()
;或 - 设置为
SO_SNDTIMEO
套接字选项一个发送超时。
- explicitly marking the file descriptor as nonblocking with
fcntl()
; or - passing the
MSG_DONTWAIT
flag tosend()
; or - setting a send timeout with the
SO_SNDTIMEO
socket option.
这篇关于哪些原因会导致袜子上发送“资源暂时不可用”()命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!