Board index » delphi » Using TidHTTP in multi-threaded application

Using TidHTTP in multi-threaded application


2004-07-15 12:09:21 AM
delphi172
From my desktop application, I am generating x number of threads (using
delphi TThread class). Each thread is calling a local CGI by using the Indy
TidHTTP component. Each CGI sends a SOAP request to an external machine
(with public IP address) and get a response back. The thread then writes the
response back to the main thread (desktop applicaiton). This is working just
fine.
If the main thread (desktop application) generates 10 threads, I can see by
looking at the Windows Task Manager (Performance tab) that 10 threads are
gernerated. I can also see that 10 CGIs are executing in the Windows Task
Manager (Processes tab).
Now, if for example, the main thread creates 50 threads, Windows Task
Manager (Performance tab) shows that 50 threads are created but the Windows
Task Manager (Processes tab) only shows 10 threads at a time. After few
observations I found that IIS 5.0 restricting the number of HTTP calls at
one given time. My first question here is that can I increase that limit???
Now, if the main thread creates 100 threads, all threads are created as
normal but for 20 of those threads throw an error like "Socket Error # 10061
Connection refused". So my second question is that why I am getting this
error even though the IIS is managing the number of threads at one given
time.
Thanks in advance.
Kash
 
 

Re:Using TidHTTP in multi-threaded application

"Kashif" <XXXX@XXXXX.COM>writes
Quote
From my desktop application, I am generating x number of threads (using
delphi TThread class). Each thread is calling a local CGI by using the
Indy
TidHTTP component. Each CGI sends a SOAP request to an external machine
(with public IP address) and get a response back. The thread then writes
the
response back to the main thread (desktop applicaiton). This is working
just
fine.

If the main thread (desktop application) generates 10 threads, I can see
by
looking at the Windows Task Manager (Performance tab) that 10 threads are
gernerated. I can also see that 10 CGIs are executing in the Windows Task
Manager (Processes tab).

Now, if for example, the main thread creates 50 threads, Windows Task
Manager (Performance tab) shows that 50 threads are created but the
Windows
Task Manager (Processes tab) only shows 10 threads at a time. After few
observations I found that IIS 5.0 restricting the number of HTTP calls at
one given time. My first question here is that can I increase that
limit???
In the IIS manager. Unless you are running the server edition of the
windows OS, you will be limited on the number of concurrent connections.
Quote
Now, if the main thread creates 100 threads, all threads are created as
normal but for 20 of those threads throw an error like "Socket Error #
10061
Connection refused". So my second question is that why I am getting this
error even though the IIS is managing the number of threads at one given
time.

Because IIS is *refusing* the http connections you are tring to make beyond
it's allowable limit.
 

Re:Using TidHTTP in multi-threaded application

I am using the Windows 2000 Server edition where there is no limit for a
number of connections. So how come I am still getting the connection refused
error?
"Jack Mays" <XXXX@XXXXX.COM>writes
Quote

"Kashif" <XXXX@XXXXX.COM>writes
news:40f55abd$XXXX@XXXXX.COM...
>From my desktop application, I am generating x number of threads (using
>delphi TThread class). Each thread is calling a local CGI by using the
Indy
>TidHTTP component. Each CGI sends a SOAP request to an external machine
>(with public IP address) and get a response back. The thread then writes
the
>response back to the main thread (desktop applicaiton). This is working
just
>fine.
>
>If the main thread (desktop application) generates 10 threads, I can see
by
>looking at the Windows Task Manager (Performance tab) that 10 threads
are
>gernerated. I can also see that 10 CGIs are executing in the Windows
Task
>Manager (Processes tab).
>
>Now, if for example, the main thread creates 50 threads, Windows Task
>Manager (Performance tab) shows that 50 threads are created but the
Windows
>Task Manager (Processes tab) only shows 10 threads at a time. After few
>observations I found that IIS 5.0 restricting the number of HTTP calls
at
>one given time. My first question here is that can I increase that
limit???

In the IIS manager. Unless you are running the server edition of the
windows OS, you will be limited on the number of concurrent connections.

>Now, if the main thread creates 100 threads, all threads are created as
>normal but for 20 of those threads throw an error like "Socket Error #
10061
>Connection refused". So my second question is that why I am getting this
>error even though the IIS is managing the number of threads at one given
>time.
>

Because IIS is *refusing* the http connections you are tring to make
beyond
it's allowable limit.

--
Jack Mays