On Thu, Dec 09, 2010 at 10:35:15AM +0000, Dietmar Maurer wrote:
> Hi all,
> 

Can we move this to the libqb mailing list?
https://fedorahosted.org/mailman/listinfo/quarterback-devel

> I am playing around with libqb writing my first test server. Normal operation 
> work
> quite good so far. I just wonder how to handle errors on the server side, 
> especially
> in qb_ipcs_msg_process_fn:
> 
> typedef int32_t (*qb_ipcs_msg_process_fn) (qb_ipcs_connection_t *c,
>               void *data, size_t size);
> 
> I thought the return value is used to indicate errors, but if I simply
> return a negative number my client hang forever.

Currently if you return anything but -ENOBUFS or -EAGAIN the server will
remove the socket from the poll loop.

To return an error to the client use qb_ipcs_response_send().
like:
{
  struct qb_ipc_response_header response;

  response.size = sizeof(struct qb_ipc_response_header);
  response.id = MY_MSG_ID;
  response.error = MY_ERROR;
  qb_ipcs_response_send(c, &response, sizeof(response));
}

Regards
-Angus

> 
> So I always need to send something back? What is the purpose of the return 
> value then?
> 
> On the client side there seems to be no timeout in qb_ipcc_sendv_recv()?
> 
> - Dietmar
> 
> 
> _______________________________________________
> Openais mailing list
> [email protected]
> https://lists.linux-foundation.org/mailman/listinfo/openais
_______________________________________________
Openais mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/openais

Reply via email to