Re: Working with curl connections as with sockets.
Date: Fri, 25 Apr 2008 00:10:48 +0200 (CEST)
On Thu, 24 Apr 2008, tetetest tetetest wrote:
> 'connect' is done using usual curl_easy_setopt()/curl_easy_perform(), so the
> application does not need to hassle with proxy/SSL negotiations and all
> 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.
That's pretty much exactly what CONNECT_ONLY does today!
> '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 were
> some public interface to send/receive data?
I guess it could be useful, but for people wanting other and different
protocols, why would they use libcurl at all in the first place?
> Currently we are forced to use predefined protocols (known by libcurl). If
> you want something non-standard, you should either implement it yourself
> from scratch (using sockets), or modify libcurl.
Well, there are also other libraries such as Apache's APR etc that should
provide a pretty good base to build on.
> I tried to write a simple libcurl application that talks to a telnet server
> and... I couldn't.
The internal telnet support is what presumably should be used for that, if
only it was good enough for it. In reality I guess it is closer to being
entirely cut out simply because it is in a state where it is hardly useful so
not many people can use it, and since it is this bad and yet nobody feels
obliged to fix it it is a proof that not that many people care for telnet
How come you selected to base your telnet attempts on libcurl? (I'm trying to
be open, to learn and to listen without judging too hard.)
-- Commercial curl and libcurl Technical Support: http://haxx.se/curl.htmlReceived on 2008-04-25