Re: Recommended architecture for streaming over multiple sockets

2016-03-11 Thread Boutin Maël
> > Based on your advices i changed my code. It seems to work but do you see > > any flaws there ? > 1. Call multi_perform > 2. If still running FDs is >= previous running FDs: call multi_wait if > there are no more data to be sent > 3. Check the message queue to get ended transfers and reinitiate

Re: Recommended architecture for streaming over multiple sockets

2016-03-10 Thread Daniel Stenberg
On Thu, 10 Mar 2016, Boutin Maël wrote: Based on your advices i changed my code. It seems to work but do you see any flaws there ? 1. Call multi_perform 2. If still running FDs is >= previous running FDs: call multi_wait if there are no more data to be sent 3. Check the message queue to get

Re: Recommended architecture for streaming over multiple sockets

2016-03-10 Thread Boutin Maël
Hi, On Wed, 9 Mar 2016, Boutin Maël wrote: Ok for curl_multi_info_read. I changed my code as follow : > > >curlret = curl_multi_perform(m_pstCurlMultiHandle, ); >>if (!iRunningFDs) >>{ >> usleep(1); >>} > > Why do you sleep when there's no more transfers running?

Re: Recommended architecture for streaming over multiple sockets

2016-03-10 Thread Boutin Maël
Hi, On Wed, 9 Mar 2016, Boutin Maël wrote: Ok for curl_multi_info_read. I changed my code as follow : > > >curlret = curl_multi_perform(m_pstCurlMultiHandle, ); >>if (!iRunningFDs) >>{ >> usleep(1); >>} > > Why do you sleep when there's no more transfers running?

Re: Recommended architecture for streaming over multiple sockets

2016-03-09 Thread Daniel Stenberg
On Wed, 9 Mar 2016, Boutin Maël wrote: Ok for curl_multi_info_read. I changed my code as follow : curlret = curl_multi_perform(m_pstCurlMultiHandle, ); if (!iRunningFDs) { usleep(1); } Why do you sleep when there's no more transfers running? /* wait for

Re: Recommended architecture for streaming over multiple sockets

2016-03-09 Thread Boutin Maël
*>*I bet this is the piece of code i need to change: > > if (bSomethingToDo) > { >// Call multi_perform >curl_multi_perform(m_pstCurlMultiHandle, ); > } > else > { >usleep(1); > } >This might seem trivial for you but i'm still learning libcurl and i find the

RE: Recommended architecture for streaming over multiple sockets

2016-03-09 Thread Yehezkel Horowitz
>I bet this is the piece of code i need to change: > > if (bSomethingToDo) > { >// Call multi_perform >curl_multi_perform(m_pstCurlMultiHandle, ); > } > else > { >usleep(1); > } >This might seem trivial for you but i'm still learning libcurl and i find the >documentation

Re: Recommended architecture for streaming over multiple sockets

2016-03-09 Thread Boutin Maël
On 3/8/2016 9:39 AM, Daniel Stenberg wrote: > On Tue, 8 Mar 2016, Boutin Maël wrote: > > Currently i call multi_perform when there are data to be sent. How can i >> obtain the send status ? By performing a select on the handles ? >> > > Yes, you would call select on the file descriptors with the

Re: Recommended architecture for streaming over multiple sockets

2016-03-08 Thread Daniel Stenberg
On Tue, 8 Mar 2016, Ray Satiro via curl-library wrote: Do you mean you plan on leaving open ~1000 connections concurrently? Wouldn't curl_multi_wait [1] be a safer choice instead of curl_multi_fdset here? Oh right, for any solution that intends to use perhaps more than a hundred

Re: Recommended architecture for streaming over multiple sockets

2016-03-08 Thread Ray Satiro via curl-library
On 3/8/2016 9:39 AM, Daniel Stenberg wrote: On Tue, 8 Mar 2016, Boutin Maël wrote: Currently i call multi_perform when there are data to be sent. How can i obtain the send status ? By performing a select on the handles ? Yes, you would call select on the file descriptors with the actions

Re: Recommended architecture for streaming over multiple sockets

2016-03-08 Thread Boutin Maël
Hi, Thank you for your anwser Daniel. I went for the multi_interface solution, coupled with a pause when there are no data to send and unpause when there are more data. I may have several connection (~1000), with a global throughput of 800Mb/s on a localhost endpoint Currently i call

Re: Recommended architecture for streaming over multiple sockets

2016-03-07 Thread Daniel Stenberg
On Wed, 2 Mar 2016, Boutin Maël wrote: 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

Recommended architecture for streaming over multiple sockets

2016-03-02 Thread Boutin Maël
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