[zeromq-dev] Clear socket's cache

Dorin Ciobanu (dciobanu) dciobanu at cisco.com
Wed Feb 15 13:28:14 CET 2012



My application uses a session oriented design.  I have a PULL socket in
a client app and a PUSH socket in a server app. Sometimes my client app
goes away, and I do not know a way to detect this in my server, so I
keep sending messages into the PUSH socket (using non-blocking flag). 

When client application starts, it asks for the queue address from the
server app (using a non-ZMQ mechanism). At that moment, I do something
to close the old session and initialize a new session, then tell the
client the address to connect to for pulling messages.

Unfortunately, my client app gets a few "old" messages before getting
new ones.


What is the best solution for this? Is there a way to "clear the cache"
on the socket? Or is there a way to detect a client is no longer

I would like to avoid close/bind because it's a multi-user machine
(windows) with concurrent processes that quite actively take and release
TCP ports. I could end up with the port occupied by competition and that
leads to a whole list of things I have to take care about.


Thanks in advance,



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20120215/83b236ed/attachment.htm>

More information about the zeromq-dev mailing list