[PATCH] Unix datagram socket messaging
Jeremy Allison
jra at samba.org
Wed Apr 23 10:03:20 MDT 2014
On Wed, Apr 23, 2014 at 03:18:40PM +0200, Stefan (metze) Metzmacher wrote:
> Am 23.04.2014 01:35, schrieb Jeremy Allison:
> > - for (i=0;i<n;i++) {
> > + /*
> > + * We have to loop at least 2 times for
> > + * each message as local ping messages are
> > + * handled by an immediate callback, that
> > + * has to be dispatched, which sends a pong
> > + * message, which also has to be dispatched.
> > + * Above we sent 2*n messages, which means
> > + * we have to dispatch 4*n times.
> > + */
> > +
> > + for (i=0;i<4*n;i++) {
> > ret = tevent_loop_once(evt_ctx);
> > if (ret != 0) {
> > break;
> > }
> > }
> >
>
> Shouldn't we just as above, something like:
>
> while (pong_count < n*2) {
> ret = tevent_loop_once(evt_ctx);
> if (ret != 0) {
> break;
> }
> }
>
> Otherwise we add a new implementation specific check,
Good point. I'll make that change and submit.
Thanks for all the review help !
Jeremy.
More information about the samba-technical
mailing list