ZLMediaKit/ZLToolKit

Service restarted, client reconnect bug

Opened this issue · 5 comments

Yesterday, the code I pulled down, the TCP client and server were running on different machines (Linux) respectively. The client connected to the server, and everything was running normally. At this time, after restarting the server device operating system and starting the TCP service, it would cause the client to be unable to reconnect, always failing with a connection timeout. The only way to fix it was to close the client and then restart it. The client would then be able to connect. Note: The server device system is restarted, and the client remains running (supports disconnection and reconnection).

昨天拉下来的代码 tcp 客户端和服务器分别运行在不同机器上(linux),客户端连接上服务端,一切运行正常,这个时候把服务端设备操作系统从新启动后启动tcp服务,就会导致客户端重连不上服务,总是连接超时失败,只能关闭客户端,在启动客户端就能连接上,注意:服务器设备系统重新启动,客户端保持运行中(支持断线重连)

TRANS_BY_GITHUB_AI_ASSISTANT

What is the git hash?

看看git hash 呢?

TRANS_BY_GITHUB_AI_ASSISTANT

I just checked the code, you are: 28b7aea

  • Fixed the issue where the TCP client failed to get the peer's IP and port (#182)
  • The bug introduced by this modification

我刚看了下代码,你是:28b7aea107089c17c6f10e8657d27a0815f85b25

  • 修正TCP客户端获取对端ip端口失败的问题 (#182)
  • 这次修改引入的这个bug

TRANS_BY_GITHUB_AI_ASSISTANT

So are you using zlm as a TCP client or server?

所以你用zlm是作为tcp客户端还是服务端?

TRANS_BY_GITHUB_AI_ASSISTANT

所以你用zlm是作为tcp客户端还是服务端?
The client and server are mostly made with ZLToolKit. The test cases are test_tcpClient and test_tcpEchoServer. I just modified test_tcpClient to support reconnection.

所以你用zlm是作为tcp客户端还是服务端?
客户端和服务端 多是用 ZLToolKit 做的,测试用例是test_tcpClient 和 test_tcpEchoServer ,我只是在test_tcpClient 上修改了下支持断线重连功能,

TRANS_BY_GITHUB_AI_ASSISTANT

Take a look at the server-side and device-side logs?

看看服务端和设备端日志?

TRANS_BY_GITHUB_AI_ASSISTANT