Working with curl connections as with sockets.
Date: Thu, 24 Apr 2008 13:42:36 +0400
It would be nice to have cooked connect, send, receive, poll, and
functions. By "cooked" I mean the following:
'connect' is done using usual curl_easy_setopt()/curl_easy_perform(), so
the application does not need to hassle with proxy/SSL negotiations and
such. The difference from regular, say, http transfer is that the
"performance" finishes after connecting to the server, not after the
protocol session is complete. After the connection is established, you
could use the handle in subsequent send/receive operations.
'send' and 'receive' (I am dreaming here) work with curl handles, not
sockets. Thus, it will be easy to write applications implementing custom
network protocols, yet capable of working though proxies and SSL
I guess that this (or similar) functionality is already in the guts of
libcurl, but is not usable from outside. Wouldn't it be great if there
some public interface to send/receive data?
Currently we are forced to use predefined protocols (known by libcurl).
you want something non-standard, you should either implement it yourself
from scratch (using sockets), or modify libcurl.
(Yes, you can send and receive arbitrary data from callback functions.
Isn't it ugly? I tried to write a simple libcurl application that talks
a telnet server and... I couldn't).
Received on 2008-04-24