Hi all,

In the FLP example from The Guide, there is a "zclock_sleep(100)" in function
flcliapi_connect, in order to allow connection to come up.

My question is :
Is it really the Good Way of making sure connection came up ?
I am afraid of relying on "sleep".

Instead of a doing a sleep like this, I am trying to determine when connection is
ready by waiting on a POLLOUT event on the socket FD obtained with
getsockopt.

Is it a good idea ?

It doesn't seem to be reliable, though (at least with my code). Sometimes it
waits enough, sometimes not.

If someone has an example of how to properly wait for connection to be
established, I would very happy to see how it is achieved.

If sleeping is not the best solution, maybe the example code in Freelance client API
should be modified with the proper solution, then.

Thanks in advance,
Matias.







_______________________________________________
zeromq-dev mailing list
[email protected]
http://lists.zeromq.org/mailman/listinfo/zeromq-dev

Reply via email to