[rabbitmq-discuss] socket read timeout in rabbitmq-c
alex chen
chen650 at yahoo.com
Thu May 6 01:44:11 BST 2010
thanks Scott for the suggestion! We actually use amqp_data_in_buffer+select to wait for the frames to be consumed. However, it is not easy to this for rpc like calls such as login/channel_open, because they call send+wait inside the function. there is no way to insert the select() between the send_method and wait_frame().
-alex
----- Original Message ----
> From: Scott Brooks <scott at beamdog.com>
> To: alex chen <chen650 at yahoo.com>
> Cc: rabbitmq-discuss at lists.rabbitmq.com
> Sent: Wed, May 5, 2010 5:33:36 PM
> Subject: Re: [rabbitmq-discuss] socket read timeout in rabbitmq-c
>
> This may not solve your exact problem but it may help
You can pull the
> socket out of rabbitmq-c with
amqp_get_sockfd
and then you can
> query
amqp_data_in_buffer
If amqp_data_in_buffer returns true, then
> the next read will return a
packet from inside it's internal buffer, and not
> check the network
If it returns false, select on the sockfd from
> amqp_get_sockfd to see
if there is data to be retrieved.
Only then
> call a possibly blocking function.
Scott
More information about the rabbitmq-discuss
mailing list