cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: can Curl use socket() created by application?

From: amit paliwal <amit.ambitions_at_gmail.com>
Date: Fri, 19 Aug 2011 00:49:04 -0400

In this case, will I be able to send an HTTP POST and get its reply...

I did not find any sample example to use this options, I need to use them in
my HTTP application. I hope this will work for HTTP.

When we use CONNECT_ONLY option, after doing some transfer by
curl_easy_send() and curl_easy_recv(), is it possible to use
curl_easy_perform() to send HTTP POST message. I read somewhere that the
curl handle created by CONNECT_ONLY can not be used in curl_easy_perform()
to send further HTTP messages. Is there some way to do this? I do not want
to have another handle, or better I say that I do not want to have another
connection with the server.

On Sat, Aug 13, 2011 at 4:27 PM, Daniel Stenberg <daniel_at_haxx.se> wrote:

> On Sat, 13 Aug 2011, amit paliwal wrote:
>
> Just want to know that is it possible for Curl to use socket created by
>> application to use in further calls to curl_easy_perform().
>>
>
> Yes!
>
> You use CURLOPT_OPENSOCKETFUNCTION to pass in the socket, and then you use
> the CURLOPT_SOCKOPTFUNCTION to return CURL_SOCKOPT_ALREADY_**CONNECTED.
>
> Requires a fairly new libcurl.
>
> --
>
> / 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>
>

-- 
Regards,
Amit

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2011-08-19