cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: question about Curl_send_plain

From: Amit Pal <amit.curl_at_gmail.com>
Date: Wed, 17 Jul 2013 14:48:34 -0400

thanks for the reply...

i was browsing the code..so i found this..please confirm

1) When from my client program I call curl_easy_perform() it uses normal
send() on tcp socket to write data.

2) then it changes state and pass fd to poll() to wait for response message.

3) once response is received it stores it in some buffer.

4) state is again changed.

now after the transfer is success, is fd removed from poll(). After this
transfer is done, I want to use the fd for some other purpose.

After this if some message comes on fd then will curl invoke poll() and
hence read operation?

On Wed, Jul 17, 2013 at 2:00 PM, Daniel Stenberg <daniel_at_haxx.se> wrote:

> On Wed, 17 Jul 2013, Amit Pal wrote:
>
> I browsed the code and came to see that Curl_send_plain internally calls
>> swrite(). So I am believing that Curl_send_plain() calls simple send() and
>> recv() functions on socket and does not perform any IO multiplexing using
>> poll() or select().
>>
>> Am I right here?
>>
>
> Yes. The multiplexing is done on a higher level than the actual
> data-sending system/libc call.
>
> --
>
> / daniel.haxx.se
> ------------------------------**------------------------------**-------
> List admin: http://cool.haxx.se/list/**listinfo/curl-library<http://cool.haxx.se/list/listinfo/curl-library>
> Etiquette: http://curl.haxx.se/mail/**etiquette.html<http://curl.haxx.se/mail/etiquette.html>
>

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2013-07-17