[zeromq-dev] Two-Way dealer-router issue.
Brian.Dowd at commerzbank.com
Fri Sep 28 13:13:22 CEST 2012
I wonder if someone could help me, I've got a class MessageRouter (MR) and it contains a listener MesageListener (ML),
MR contains the outgoing socket which is a ROUTER (socket-1) and the ML contains the incoming socket which is a DEALER (socket-2).
The MR class can start up as a "server" or as a "client" - the only real difference being that if is is a "server" then it binds to
the socket otherwise (client) it connects to the socket. After I connect or bind the MR/ROUTER part I do a 5 second sleep,
and after I connect or bind the ML/DEALER part I do a 5 second sleep.
So I have a bi-directional router-dealer and dealer-router over a pair of sockets relationship, like this:
It all seems to work most of the time, however the closer/faster it gets the more issues I see -
Server & client on different machines - works OK.
Server & client on same machine
- TCP - works sometimes, though not often
- IPC - never works
What appears to be happening is (based on tracing in TCP mode on the same machine)
- server starts and binds to 55558, 55559
- client starts up and connects to them, netstat indicates the correct 2 ports listening and 4 established connections.
- the client sends a LOGIN_REQUEST to the server over port 55559, the server receives it and sends a LOGIN_RESPONSE
back over port 55558
- The LOGIN_RESPONSE is never seen by the client.
TCP dump indicates that nothing is being sent from the server to client over 55558,
It also indicates that nothing is being dropped by the kernel, however the debugging I have in place in
my code indicates that it is writing it to the ZMQ layer.
Unfortunately from reading I see that it is not really possible to debug or get trace logging into the ZMQ native libraries....
What else I've tried:
- I wrote a simple client-server using my MR & ML class, and deployed it and it seemed to work OK.
The client just connects and sends a login request, then the server receives it sends a login response
back and then starts send HEARTBEAT messages - this worked fine for TCP & IPC.
- I integrated into my real client & server and it failed.
- I stripped my real client/server down to be skeletal from the original i.e. does nothing but handle
a login, also removed any other native libs the server needed (tib for example).
Details OS - Windows XP (and fails similarly on Linux), using java 1.6.0-20, and zmq library 3.2.0-rc1.
Any suggestions on how I can proceed/diagnose this issue further would be greatly appreciated.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the zeromq-dev