cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Sleep and wakeup on http request AND communication socket number

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Thu, 25 Oct 2012 15:14:22 +0200

On Thu, Oct 25, 2012 at 07:28:28PM +0800, JALINDAR wrote:
> Then how to get at least opened socket for handle by libcurl.............as i
> have to send this port number to the server

This is obviously not for one of the standard protocols that libcurl
supports, then. There is a way to get the socket being used by an easy
handle, and it can be used for nonstandard hacks: the curl_easy_getinfo
option CURLINFO_LASTSOCKET. There are also a couple of callbacks that
can be used to access sockets as they're created:
CURLOPT_SOCKOPTFUNCTION and CURLOPT_OPENSOCKETFUNCTION. You're on your
own if you use these to change the socket state from what libcurl
believes it to be, though.

>>> Dan
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2012-10-25