> :-( I cant handle it ;-(((( I dont really understand the HTTPAsy example
> ;-( Could anybody help me?

HttpAsy is a simple application which take a list of URL and either get
those URL one after the other (sequencially) or get all at the same time
using a component for each one.

> For example i got a an edit, where im deciding
> how may "threads" (simaltaneous async http components) are going to be
> used... for example ... 50..., got some memo... every line of memo is some
> http address... and other memo as output...

Well, that is basically what HttpAsy sample does, except it create as much
component as you have URL.

> now i woulike it to check every
> server at memo (like it had 50 threads) and put the output to output
memo...
> but if the connection times out, it add the server again to check to the
end
> of the list ...

You need:
- A TStringList with all URL to get, call it UrlToGetList
- A TSringList with all URL that are being processed, call it
UrlBeingGetList
- A TObjectList with 50 HTTP Component, call it FreeHttpCliList
- A TObjectList with all Http components that are busy getting URL, call it
BusyHttpCliList
- When you start the process, you have a loop that will iterate thru the
FreeHttpCliList. For each one, extract an url from UrlToGetList, move tha
url to the UrlBeingGetList and start a HttpCli.GetAsync, move the Http
component to the BusyHttpCliList. When the UrlToGetList is empty or
FreeHttpCliList is empty, break the loop. Use the Tag property of the Http
component to store the time you started to get the URL.
- Use a TTimer which will iterate thru the BusyHttpCliList, checking the tag
against the current time to find out which one has timed out. If timed out,
call his Abort method.
- From the OnRequestDone on all Http component, print the result of the get,
move the component to the FreeHttpCliList and postmessage a custome message
to your form. The corresponding message handler will start the process
again. If the url failed to be got, move it again to the UrlToGetList,
otherwise, remove it from the list where it is.

--
[EMAIL PROTECTED]
Auteur du freeware ICS - Internet Component Suite
Auteur du middleware multi-tiers MidWare
http://www.overbyte.be


-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to