客户端<clientid>上的套接字错误,正在断开连接

时间:2019-07-22 04:05:34

标签: sockets mqtt mosquitto broker

我正在运行一个蚊子经纪人,并且有两个节点正在交互。一个是android应用程序,另一个是节点应用程序。一切都在本地运行良好,但是当我将它托管在具有不同IP地址的服务器上时,代理会通过一条错误消息“表明Socket错误...”断开了android的连接,通信是WebSocket。

不是防火墙问题,请编辑规则以包括端口

1563531509: New client connected from 115.110.139.126 as mqttjs_8eceda19 (p2, c1, k60).
1563531509: No will message specified.
1563531509: Sending CONNACK to mqttjs_8eceda19 (0, 0)
1563531522: Received PUBLISH from mqttjs_8eceda19 (d0, q2, r0, m56220, 'navigation', ... (66 bytes))
1563531522: Sending PUBREC to mqttjs_8eceda19 (m56220, rc0)
1563531522: Received PUBREL from mqttjs_8eceda19 (Mid: 56220)
1563531522: Sending PUBLISH to RepositoryClient (d0, q1, r0, m1, 'navigation', ... (66 bytes))
1563531522: Sending PUBCOMP to mqttjs_8eceda19 (m56220)
1563531522: New client connected from 115.110.139.126 as mqttjs_98f933df (p2, c1, k60).
1563531522: No will message specified.
1563531522: Sending CONNACK to mqttjs_98f933df (0, 0)
1563531522: Socket error on client RepositoryClient, disconnecting.
1563531522: Received SUBSCRIBE from mqttjs_98f933df
1563531522:     test (QoS 2)
1563531522: mqttjs_98f933df 2 test
1563531522: Sending SUBACK to mqttjs_98f933df
1563531524: New client connected from 115.110.139.126 as RepositoryClient (p2, c0, k6464).
1563531524: No will message specified.
1563531524: Sending CONNACK to RepositoryClient (1, 0)
1563531524: Sending PUBLISH to RepositoryClient (d1, q1, r0, m1, 'navigation', ... (66 bytes))
1563531524: Socket error on client RepositoryClient, disconnecting.

1 个答案:

答案 0 :(得分:1)

显然,订阅期间客户端抛出了一个异常,并且客户端正在尝试使用相同的ID重新连接。因此,套接字错误。解决异常原因可以解决此问题。