zeromq / jeromq

Pure Java ZeroMQ
Mozilla Public License 2.0
2.34k stars 484 forks source link

The server cannot receive messages after running for a period of time #988

Open ProgramDance opened 1 month ago

ProgramDance commented 1 month ago

Use SocketType PAIR mode. After connecting to the server, the client can receive and receive data normally. But after running for a period of time, the server cannot receive data.

trevorbernard commented 1 month ago

@ProgramDance can you provide a bit more information? Because JeroMQ doesn't support inproc (just yet), it's not a suitable socket type.

While PAIR sockets can be used over transports other than inproc, their inability to auto-reconnect coupled with the fact that new incoming connections will be terminated while any previous connections (including ones in a closing state) exist makes them unsuitable for TCP in most cases.

I would suggest generally to use dealer/router in a server type application without knowing more information.

You can read more about the PAIR socket type here: https://zeromq.org/socket-api/#exclusive-pair-pattern