0 Replies Latest reply on Oct 17, 2011 6:27 AM by andres margalef

    Timeouts 30 secs on Air 4.5.1 and older versions

    andres margalef

      This example always fail at 30 seconds, and trace(event) is

      "[FaultEvent fault=[RPC Fault faultString="Error de solicitud http" faultCode="Server.Error.Request" faultDetail="Error: [IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2032: Stream Error. URL: http://localhost:8080/MyApplication/test" errorID=2032]. URL: http://localhost:8080/MyApplication/test"] messageId="6C1C6347-E307-7991-AAA4-120966B49909" type="fault" bubbles=false cancelable=true eventPhase=2]"

       

      Other examples using remoteObject with requestTimeout="99999" the trace(fault) is

      "[RPC Fault faultString="error" faultCode="Channel.Call.Failed" faultDetail="NetConnection.Call.Failed: HTTP: Failed"]"

       

      Other example using FileReference, the trace(fault) is

      "[IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2038: File I/O Error. URL: http://localhost:8080/MyApplication/test" errorID=2038]"

       

      Always at 30 seconds after, why?

       

      FLEX - AIR CODE

      <?xml version="1.0" encoding="utf-8"?>

      <s:WindowedApplication

                xmlns:fx="http://ns.adobe.com/mxml/2009"

                xmlns:s="library://ns.adobe.com/flex/spark"

                xmlns:mx="library://ns.adobe.com/flex/mx"

                >

       

                <fx:Declarations>

                          <s:HTTPService

                                    id="httpService" url="http://localhost:8080/MyApplication/test"

                                    fault="eventHandler(event)" result="eventHandler(event)" requestTimeout="99999"/>

                </fx:Declarations>

       

                <fx:Script>

                          <![CDATA[

                                    private var fecha:Date;

       

                                    private function testHttpService(event:MouseEvent):void {

                                              fecha = new Date();

                                              httpService.send();

                                    }

       

                                    private function eventHandler(event:Event):void {

                                              var now:Date = new Date();

                                              trace("time elapsed:" + (now.getTime() - fecha.getTime()));

                                              trace(event);

                                    }

                          ]]>

                </fx:Script>

       

                <s:Button id="btnHttpService" label="httpServiceTest" click="testHttpService(event)" />

      </s:WindowedApplication>

       

      JAVA SERVLET:

      public class TestServlet extends HttpServlet {

                @Override

                protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {

                          try {

                                    Thread.sleep(60000);

                          } catch (InterruptedException e) {

                                    e.printStackTrace();

                          }

                }

      }