![]() |
What Is The Use Of libconic Api And How libconic and curl Http Are realted
Hai All,
I read abt libconic api and i don't understand how it is usuful to access the intenet. i understand that if an application want to use the internet(to select the IAP) we must use the libconic api. Then only we can get info from the webpage using curl http. My Openion is correct or wrong? libconic is the only monitor to internet connections? is ConIcConnection pointer is used in curl http? thanks and regards kamesh.smartdude. |
Re: What Is The Use Of libconic Api And How libconic and curl Http Are realted
I'm not an expert of the Maemo APIs (haven't used any lol), but to my knowledge libconic provides a way to handle your connections even if user is switching between e.g. 3G, GSM and WLAN.
|
Re: What Is The Use Of libconic Api And How libconic and curl Http Are realted
yes, libconic is used to handle connections (setup, switch, shutdown). It has nothing to do with curl. For curl you do something like this:
CURL *curl; CURLcode res; curl = curl_easy_init(); curl_easy_setopt(curl, CURLOPT_URL, url); curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void *)&resultchunk); curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, curl_writebuffer); curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1); res = curl_easy_perform(curl); curl_easy_cleanup(curl); Obviously you'll want some error checking in there too ;) |
Re: What Is The Use Of libconic Api And How libconic and curl Http Are realted
// Following fn from liq*, thanks Gary/lcuk
static size_t curl_writebuffer(void *ptr, size_t size, size_t nmemb, void *data) { struct curl_memorybuffer *mem = (struct curl_memorybuffer *) data; int realsize = size * nmemb; printf("In memory write callback, size=%d\n", realsize); mem->memory = (char *)realloc(mem->memory, mem->size + realsize + 1); if (mem->memory){ memcpy(&(mem->memory[mem->size]), ptr, realsize); mem->size += realsize; mem->memory[mem->size] = 0; } return realsize; } |
Re: What Is The Use Of libconic Api And How libconic and curl Http Are realted
Quote:
Is There Any reference document or any examples to access internet using both libconIC and curl? |
Re: What Is The Use Of libconic Api And How libconic and curl Http Are realted
Quote:
Quote:
http://curl.haxx.se/libcurl/c/example.html And some Maemo4 linconIC examples here http://maemo.org/maemo_release_docum...00000000000000 Perhaps the easiest thing to do would be to start the connection manually using the maemo UI for the time being and to concentrate on getting libcurl to work in your application. Once this is working you can integrate libiconic Code:
mem->memory = (char *)realloc(mem->memory, mem->size + realsize + 1); |
All times are GMT. The time now is 20:19. |
vBulletin® Version 3.8.8