4 Replies Latest reply on Oct 10, 2010 10:04 PM by Flex harUI

    Flex doesn't support asynchronous AMF requests?!

    RandomReado Level 1

      In my application I'm calling 2 remote PHP methods one after the other as follows:





      When I go to the Network Monitor view I can see both methods completing OK, however the time elapsed for method2() is in excess of 500ms compared to method1() which is only 10ms.


      If I click on the Raw View tab, this is what I see:




      POST /AMF.php HTTP/1.1
      Referer: app:/MyApp.swf
      Accept: text/xml, application/xml, application/xhtml+xml, text/html;q=0.9, text/plain;q=0.8, text/css, image/png, image/jpeg, image/gif;q=0.8, application/x-shockwave-flash, video/mp4;q=0.9, flv-application/octet-stream;q=0.8, video/x-flv;q=0.7, audio/mp4, application/futuresplash, */*;q=0.5
      x-flash-version: 10,1,53,64
      Content-Type: application/x-amf
      User-Agent: Mozilla/5.0 (Windows; U; en) AppleWebKit/531.9 (KHTML, like Gecko) AdobeAIR/2.0.2
      Host: server.mydomain.local
      Content-Length: 623
      Flex Message (flex.messaging.messages.RemotingMessage)     operation = refreshVideos    clientId = 34A1B2A6-FDCF-7B29-2304-000061318C0C    destination = zend    messageId = 86BFDAA4-3E1E-6FF2-13D9-919099F159D3    timestamp = 0    timeToLive = 0    body =     [      420,      1002    ]    hdr(DSId) = nil    hdr(DSEndpoint) = my-zend


      I would expect the raw output of method2() to be the same, but it's not:


       ServiceRequest: refreshSelected; RemoteService; refreshSelected
        body = (Array)#1
          [0] "1002"
        clientId = "34A1B2A6-FDCF-7B29-2304-000061318C0C"
        destination = "zend"
        headers = (Object)#2
          DSEndpoint = "my-zend"
          DSId = "nil"
        messageId = "D77C5CD5-A1F9-8A37-5768-919099F24B8B"
        operation = "refreshSelected"
        source = "ProjectCreator"
        timestamp = 0
        timeToLive = 0


      One request uses the Flex class whereas the other uses the MX class. If I send one request, wait for it to finish then send another, both raw outputs are identical.


      Does Flex support asynchronous AMF requests? Does anyone know what could be causing this?


      Thanks in advance.