[zeromq-dev] Hints about async pattern
Marco Trapanese
marcotrapanese at gmail.com
Wed May 23 19:54:37 CEST 2012
Il 23/05/2012 19:19, Marco Trapanese ha scritto:
> I'm sure I miss something. May you help me to better understand how to
> manage this situation?
Perhaps I found a simple solution. I don't know if it's a good practice,
please feel free to tell me what you think.
The server send a dummy message to test the client. If the client
acknowledges, the server sends the actual message.
In this way if the client is down only the dummy message is in the
queue, the clients acks when reconnects but the server will ignore it.
If the connection is lost just after the ack (very unlikely) the client
will receive the naked message, without the dummy one. So it will reject it.
In other words, I'm going to test the connection a while before send the
message.
What do you think about?
Marco
More information about the zeromq-dev
mailing list