作者:grafopenshaw_460 | 来源:互联网 | 2023-07-23 15:15
I noticed a problem using the BUS sockets over TCP that the recv hangs.
I was able to reproduce this in the bus.c test by modifying the these lines:
1 2
| #define SOCKET_ADDRESS_A "tcp://127.0.0.1:5558"
#define SOCKET_ADDRESS_B "tcp://127.0.0.1:5559" |
Running the test will hang on the first nn_recv.
However, I found a work around by adding nn_sleep (10) prior to each test_send.
该提问来源于开源项目:nanomsg/nanomsg
Yep. This is TCP slow start. This is a well understood problem, you need to wait a bit before doing recv or send on a connection, or you need to assume that the first message may/will be dropped.
Closing.