curl-library
Recommended architecture for streaming over multiple sockets
Date: Wed, 2 Mar 2016 09:28:38 +0100
Hi folks,
I'm currently using libcurl to send data over a nginx local server using
HTTP POST and transfer-encoding chunked.
My application is fed with buffers which i have to send as soon as i get
them. These buffers may belong to various endpoints on the nginx server.
My question is, what use of libcurl would you recommend for this task. I
saw two options:
1. Multiple threads
I'd have one thread with a FIFO queue that would get the buffers and get a
thread from a pool. This thread would then send the buffer to nginx
2. One thread and multi interface
I'd here work in non blocking mode with the multi interface. I'm not sure
how i'd have to implement it and it seems quite overkill to me.
Technical notes that may direct your answer:
* The connection with the server must not be closed even if there are no
more data to send.
* If we cannot send data on the connection that it must be closed and
reopened.
Thanks in advance,
Regards,
-- Maël BOUTIN
-------------------------------------------------------------------
List admin: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2016-03-02