On Wed, Dec 18, 2013 at 6:40 AM, Yun Wu <wuyun1984_1984@163.com> wrote:
> Thanks.
>
> mosquitto_lib_init() is already called in my codes.
>
> In fact I just want reliable APIs for publish/subscribe/..., which means
> when they return SUCCESS, everything is indeed successfully finished.
>
> Do you have any idea of implementing them based on libmosuiqtto APIs?
>
> --
> You received this bug notification because you are subscribed to
> mosquitto.
> https://bugs.launchpad.net/bugs/1261683
>
> Title:
> Blocking mode is not really supported
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/mosquitto/+bug/1261683/+subscriptions
Something like this should work, assuming you really are waiting for
the publish to complete before sending another publish of course.
void on_publish(struct mosquitto *mosq, void *userdata, int mid)
{
int *r = userdata;
if(r){
*r = 0;
}
}
... userdata_ set(mosq, &run);
mosquitto_
...
run = 1; publish( mosq, ...);
mosquitto_
while(run){ loop(mosq, -1, 1);
rc = mosquitto_
if(rc != MOSQ_ERR_SUCCESS){
/* Handle error */
}
}
On Wed, Dec 18, 2013 at 6:40 AM, Yun Wu <wuyun1984_ 1984@163. com> wrote: lib_init( ) is already called in my codes. subscribe/ ..., which means /bugs.launchpad .net/bugs/ 1261683 /bugs.launchpad .net/mosquitto/ +bug/1261683/ +subscriptions
> Thanks.
>
> mosquitto_
>
> In fact I just want reliable APIs for publish/
> when they return SUCCESS, everything is indeed successfully finished.
>
> Do you have any idea of implementing them based on libmosuiqtto APIs?
>
> --
> You received this bug notification because you are subscribed to
> mosquitto.
> https:/
>
> Title:
> Blocking mode is not really supported
>
> To manage notifications about this bug go to:
> https:/