cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Need for CURLOPT_SOCK_TYPE

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu, 21 Sep 2006 09:46:10 +0200 (CEST)

On Wed, 20 Sep 2006, Gisle Vanem wrote:

> I once a long time ago mentioned the idea to let libcurl support unknown
> schemes. Now my need has arisen to support the SNMP v1 protocol for a simple
> SNMP oid request tool (on port 161). The idea is to have libcurl do the
> connection part and let WinSNMP API do the rest. E.g.

> curl_easy_setopt (request, CURLOPT_CONNECT_ONLY, 1);
> curl_easy_setopt (request, CURLOPT_URL, host);
> curl_easy_setopt (request, CURLOPT_PORT, 161);
> curl_easy_perform (request);
> ....
> Curl_snmp_connect (host, oid); /* WinSNMP details */
> Curl_snmp_disconnect();
> curl_easy_cleanup (request);
>
> This almost works, but unfortunately libcurl uses SOCK_STREAM for all
> protocols except tftp. I need SOCK_DGRAM for the socket-type. With a new
> option CURLOPT_SOCK_TYPE it would work fine. Any comments or words against
> adding this?

First, this won't work if you use a proxy to CONNECT through or similar since
then you need STREAM for that.

Then, why would you want to use libcurl to do this very simple task? Since
using a proxy isn't possible, all you really do is a connect(). Seems like
overkill to go over libcurl...?

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
Received on 2006-09-21