[PATCH] Unix datagram socket messaging

Stefan (metze) Metzmacher metze at samba.org
Wed Apr 23 07:18:40 MDT 2014


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,

metze


More information about the samba-technical mailing list