If I were you, I would simply add the requestId into the server's
response, so client always knows which request-response pair it
handles. This idea lies behind most of the transmissions protocols.

Cheers,
Dmitri.



--- In flexcoders@yahoogroups.com, "lagos_tout" <[EMAIL PROTECTED]> wrote:
>
> Hi,
> 
> I'm re-using an instance of HTTPService, changing the request 
> arguments to get different responses from the server.  But I found 
> that if, for instance, I made 3 calls this way with the HTTPService, 
> each of the 3 result handlers registered for each call is executed 
> every time a result returned.  
> 
> I solved this by storing a reference to the unique AsyncToken returned 
> by each service call and matching it to the AsyncToken contained in 
> each ResultEvent's "token" property in order to determine which result 
> handler to execute. 
> 
> I'm not terribly happy with this setup.  It seems messy.  I'd 
> appreciate any suggestions on how I can reuse an HTTPService instance 
> without ending up with long switch statements with countless "if 
> thisAsyncToken then do thisHandler, else if thatAsyncToken then do 
> thatHandler... and so on".
> 
> Thanks much.
> 
> LT
>


Reply via email to