域套接字" SENDTO"遭遇"错误号111,连接被拒绝" [英] domain socket "sendto" encounter "errno 111, connection refused"

查看:1396
本文介绍了域套接字" SENDTO"遭遇"错误号111,连接被拒绝"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用域套接字从另一个进程中获取值,就像一个摆脱B中的值,它运作良好几个月。但最近,A是在SENDTO消息,错误号111,连接被拒绝偶尔到B失败。

I am using domain socket to get values from another process, like A to get a value from B, It works well for months. But recently, A is failed during "sendto" message to B with "errno 111, connection refused" occasionally.

我查了B区套接字绑定文件,它是存在的。我也做在另一台机器的一些测试,也是行之有效的。因此,没有人之前遇到这样的问题?任何人都可以有一些线索什么可能是在这种情况下可能是错的?非常感谢。

I checked the B domain socket bind file, it is exists. I also do some tests in another machine, also works well. So, does anyone encounter this problem before? Can anyone have some clues what might be probably wrong in this scenario? Thanks very much.

推荐答案

当我看到这个错误与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.

这篇关于域套接字&QUOT; SENDTO&QUOT;遭遇&QUOT;错误号111,连接被拒绝&QUOT;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆