cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: port

From: gbiny <gbiny_at_ptd.net>
Date: Tue, 27 Jan 2004 15:05:12 -0500

----- Original Message -----
From: "Mohit Kumar" <mohitkumar17_at_yahoo.com>
To: <curl-library_at_lists.sourceforge.net>
Sent: Tuesday, January 27, 2004 4:15 AM
Subject: port

> Hi Daniel.
>
> Sorry for troubling u so much but since i am new to
> the curl library i am facing a lot of simple issues.
> it woudl be great if u coudl answer the following
> questions:
>
> 1. Is there anyway of assigning a valid port no. to a
> HTTP port?
I'm not 100% sure what you mean, but if you're asking how to specify a port,
you can specify the port in the URL you pass to CURLOPT_URL:
curl_easy_setopt(curl, CURLOPT_URL, http://www.mysite.com:90/index.html);

> 2. suppose i am open one easy handle and before
> closing this one i open another. Then are these two
> handles accessing the net using two different threads
> or throught he same thread?

Libcurl itself does not create any threads (really, no library should ever
spawn its own threads). If you want to use multiple threads for easy
handles, then you have to handle the thread creation yourself. Remember,
each system has a different method for threading, there would be no way for
libcurl to do this for you.
http://curl.haxx.se/lxr/source/docs/examples/multithread.c provides a good
example of how to use libcurl with threads (pthreads in particular) to
accomplish multiple transfers at once.

I want to have a dynamic
> support to for access to files on my appication,
> curl_multi_perform as suggested by you is a good
> option but it require sall handles to be appended
> before perform? Is there any way of doing this
> dynamically?
As Daniel said, you can add easy handles between calls. I do just that in my
program and it works fine. The thing to remember with using the multi
interface though is it's up to you to manage the select() loop.

Dominick Meglio

-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
Received on 2004-01-28