cURL / Mailing Lists / curl-library / Single Mail

curl-library

Need for CURLOPT_SOCK_TYPE

From: Gisle Vanem <giva_at_bgnett.no>
Date: Wed, 20 Sep 2006 21:33:30 +0200

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?

--gv
Received on 2006-09-20