문제

I've got question about responses via HTTPService in flex.

I send service call to the server in the loop to scale some images, like:

while(i < 5)
{
    scaleMyImage({ file: fileArray[i], width: 100, height: 100 }); //this method is going to HTTPService

   i++;
}

[Another class] Then I receive the onResult fine, like

onResult($event:ResultEvent):void
{
    trace($event.result) //Hey mister your image is scaled down!
}

That works perfect, but I am worried about time between sent call and received response.

Loop sends the files immediately (some small miliseconds between each loop) callTime: 9.1 callTime: 9.2 callTime: 9.4 callTime: 9.6 callTime: 9.7

but, result gives me response back with delay around second resultTime: 10.8 resultTime: 11.7 resultTime: 12.9 resultTime: 14.2 resultTime: 15.0

My question is, where is the issue? I thought if I send in the loop 5 calls, server will handle the scaling (it will take around 1,5 second to scale all of them) and then it will give me back immediately in the response 5 messages that the scaling went fine. Is this issue of the Flash, server? or there is no issue at all? and i shouldn't worry about it?

도움이 되었습니까?

해결책

I know you asked this a few days ago, but if you still need to know what's up...

To support concurrent calls... you need to use the MXML version of HTTPService rather than the AS class HTTPService. The concurrency class rpc.mxml.Concurrency is only imported into the mxml implementation. So use the mx.rpc.http.mxml.HTTPService as a MXML component on your page and it will work as you hoped!

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top