且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

域套接字" SENDTO"遭遇"错误号111,连接被拒绝"

更新时间:2021-10-12 15:06:22

当我看到这个错误与Unix域套接字,它通常是因为进程B没有运行,或者出现在连接路径的不匹配。 (若B死,不是自动重启?是否有可能,虽然B已经死亡,但尚未重新启动失败的发生?)。另一种可能性:这可能是A的多个副本在同一时间运行?您可能会收到ECONNREFUSED错误,如果B的还未接受的连接队列已满。

When I've seen this error with unix domain sockets, it's usually because the process B isn't running, or there is a mismatch in the connection paths. (If B dies, does it automatically restart? Is it possible that the failures are happening while B has died but not yet restarted?). Another possibility: is it possible that multiple copies of A are running at the same time? You may get the ECONNREFUSED error if B's queue of not-yet-accepted connections is full.

我会建议在 strace的运行这两个进程A和B,或者:

I would suggest running both processes A and B under strace, either:

strace -o A.log A

或者,如果该处理已经在运行,

or, if the process is already running,

strace -o B.log -p <process-id-of-B>

此外,

netstat -na

会给你系统中的所有UNIX域套接字present的状态。

will give you the status of all unix domain sockets present in the system.