Hi Liyong,

If you can make requests idempotent (i.e. you can execute the same one
more than once, safely) then you don't have to close the socket.

As Chuck says, use an async XREQ socket and re-send the request.  The
server can use REP.  These socket types are explained in Chapter 3 of
the user guide.

-Pieter



On Sun, Sep 19, 2010 at 3:00 PM, liyongyan <[email protected]> wrote:
> Can I ask another question?
>
> I use the zmq_poll() in REQ-REP pattern
>
> When the client send a Req and then wait for res from the server ,
>
> but the Res can not reach the client in time for some reasons(for example,
> handle the Req for a long time),
>
> then the client wait timeout, now how to handle the socket?
>
> If I call the zmq_close()  and  next time when send a Req I build another
> socket and connect server again,
>
> what happen after the server send the delayed Res? What will server do in
> ZMQ with the former connection to the client?
>
>  Will the server release the related resource assigned to the former
> connection?
>
> _______________________________________________
> zeromq-dev mailing list
> [email protected]
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>
>



-- 
-
Pieter Hintjens
iMatix - www.imatix.com
_______________________________________________
zeromq-dev mailing list
[email protected]
http://lists.zeromq.org/mailman/listinfo/zeromq-dev

Reply via email to