Me wrote: > ---- Wiadomosc Oryginalna ---- > Od: Francois PIETTE <[EMAIL PROTECTED]> > Do: ICS support mailing <[email protected]> > Data: Sat, 17 Dec 2005 16:25:56 +0100 > Temat: Re: [twsocket] HTTPCLI GETASYNC and SLEEP? > >> >>> I wouldlike to implement retries on HTTPCLI but so it would wait some >>> time before retrying... Sleep doesnt seems to be the right > choice >>> because it ruins GetAsync... Any way to make a async sleep for >>> getasync? >> >> You never "wait" with ICS since it is asynchronous. >> You can implement retries using a timer. When you start your request (for >> example your GetAsync), you start a timer. When the request is > done >> (OnRequestDone), you clear the timer. If your timer event triggers, then >> you have a timeout and need to retry. You then call Abort to stop the >> current request and then restart the whole thing. Don't forget to count >> the number of retries to avoid infinite retrying... >> > > Ok but... i got 20 HTTPCli components working as multithreading...
You can store current time of your request in the component (i.e. property Tag and GetTickCount) When the timer fires iterate thru the list of HTTPCli components and check that value against your timeout. If property Tag isn't enough derive your own component and add the properties you need. That way the timeout is not very exact but that shouldn't matter. --- Arno Garrels [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html -- 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
