0 Replies Latest reply on May 12, 2010 8:55 AM by netrickster2000

    HTTPService and requestTimeout connection issue.

    netrickster2000
      I could really use some help with using the requestTimeout with HTTPService. I have successfully coded the timeout to 10 seconds and tested it with a long running http request. After 10 seconds the fault listener does execute properly. The trouble I have been observing is extreme delays when other HTTPServices starting and completing. There were major delays with them finishing their http request. At this point I fired up the fiddler web debugger. It appears that the http request does not disconnect after the timeout logic is called in actionscript. I have also tried the HTTPServices disconnect method in the fault listener. Does anyone have any suggestions?

       

      Thanks in advance.

       

      Here is my test  code:

       

      private var httpService:HTTPService = null;

       

      private function  TestTimeOut():void
      {
      httpService = new HTTPService();
      httpService.url = "http://someurl";
      httpService.method = "post";
      httpService.resultFormat = "e4x";
      httpService.requestTimeout = 10;
      httpService.addEventListener(FaultEvent.FAULT, onFaultHttpService);
      httpService.addEventListener(ResultEvent.RESULT,  onResultHttpService);
      httpService.send();
      }

       

      protected function onResultHttpService(e:ResultEvent):void
      {
      Alert.show("Success.");
      }

       

      protected function onFaultHttpService(e:FaultEvent):void
      {
      httpService.disconnect();
      Alert.show("Failed.");
      }