nanomsg / nng

nanomsg-next-generation -- light-weight brokerless messaging
https://nng.nanomsg.org
MIT License
3.78k stars 485 forks source link

nng_socket_set_ms didn't work #1841

Closed MuNianCi closed 2 months ago

MuNianCi commented 3 months ago

Describe the bug When I use the req-rpy mode of the NNG protocol for programming. I set the reconnection time for the client's socket. However, using Wireshark, I found that the TCP handshake[SYN] packet was not resent according to the set time.

Expected behavior It should resent [SYN] packet according to the time set.

Actual Behavior The interval between the [SYN] packets it sends is random.

To Reproduce If possible include actual reproduction test code here. Minimal C test cases are perferred.

Environment Details

Additional context Add any other context about the problem here. Downloads.zip

gdamore commented 3 months ago

I'm not sure what you expected to happen. Reconnection only happens if the session is disconnected. It does not disconnect a session that is healthy.

MuNianCi commented 2 months ago

After using the nng_socket_set_ms() function, in the req-rep mode, when the rep side is restarted after being shut down, should the req side automatically reconnect based on the settings applied? Perhaps I should take a good look at the source code, thank you ~~