Welcome, Guest
  • Author Topic: Error #2044: Unhandled ioError:. text=Error #2032: Stream Error. URL:  (Read 23645 times)

    GavynE

    • Server what's that
    • *
    • Posts: 4
      • View Profile
      • Email
    Hello Community,

    I have an swf that sends info to a PHP file which in turn gets a SWF to FLV converter running. If I try this with a small 1kb swf file it works great and returns the results with in 5 seconds. However now that I step it up to convert the files in which it was intended, files ranging around 2 mbs, I get this error..

    Error opening URL 'http://192.168.70.106/convert.php'
    Error #2044: Unhandled ioError:. text=Error #2032: Stream Error. URL: http://192.168.70.106/convert.php
    at conRe_fla::MainTimeline/saveFunc()
    at conRe_fla::MainTimeline/conRe_fla::frame1()

    I have looked into this error for sometime and found it means many different things. But mostly that I have the wrong URL... which is wrong cause my experiment works just fine... with a smaller SWF. Yes the bigger SWF is named correctly.

    If I type..

    http://192.168.70.106/convert.php?file=Snowmen.swf

    directly into the address bar of my firefox browser then after a brief wait of about 1 min it returns the variable and completes the conversion as well. So its only when the SWF tries do I get any sort of problem at all.

    Any ideas on how to work around this problem?

    I have continued my search and added an addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler); listener... my newest error is...

    Error opening URL 'http://192.168.70.106/convert.php'
    error: [IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2032: Stream Error. URL: http://192.168.70.106/convert.php"

    Jorge Solis

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 14616
      • View Profile
    Usually after 30 seconds a timeout fires the error, so 1 minute or more is enought for Flash to believe there's no answer. I don't know exactly how're you calling the FLV, but try to send the file and use a Timer to load the FLV until you success (use try/catch blocks in the NetStream.play to sort the runtime error)

    Jorge

    GavynE

    • Server what's that
    • *
    • Posts: 4
      • View Profile
      • Email
    Here is my code sorry there was not attachment feature to these forums that i found


    var file:String "Snowmen.swf";
    var 
    fileU:String "someFlv";
    function 
    saveFunc():void {
    	
    addEventListener(Event.ENTER_FRAMEtimer);
    	
    var 
    variables:URLVariables=new URLVariables();
    	
    variables.file=file;
    	
    variables.fileU=fileU;
    	
    var 
    richiesta:URLRequest=new URLRequest();
    	
    richiesta.url=('http://192.168.70.106/convert.php');
    	
    richiesta.method=URLRequestMethod.POST;
    	
    richiesta.data=variables;
    	
    var 
    loader:URLLoader=new URLLoader();
    	
    loader.dataFormat=URLLoaderDataFormat.BINARY;
    	
    loader.addEventListener(IOErrorEvent.IO_ERRORioErrorHandler);
    	
    addLoaderListenersSend(loader);
    	
    try {
    	
    	
    loader.load(richiesta);
    	
    } catch (
    error:Error) {
    	
    	
    trace('Unable to load the document.');
    	
    }
    }
    function 
    addLoaderListenersSend(d:IEventDispatcher):void {
    	
    d.addEventListener(Event.OPEN,inizioSend);
    	
    d.addEventListener(ProgressEvent.PROGRESS,inProgressoSend);
    	
    d.addEventListener(Event.COMPLETE,completatoSend);
    	
    d.addEventListener(SecurityErrorEvent.SECURITY_ERROR,securityErrorSend);
    }
    function 
    inizioSend(e:Event):void {
    	
    trace('start');
    }
    function 
    inProgressoSend(e:ProgressEvent):void {
    	
    trace('Progress: '+e.bytesLoaded+' totale: '+e.bytesTotal);
    }
    function 
    completatoSend(e:Event):void {
    	
    removeEventListener(Event.ENTER_FRAMEtimer);
    	
    var 
    vars:URLVariables=new URLVariables(e.target.data);
    	
    if (
    vars.conRe == "1") {
    	
    	
    flvPlayer.source "http://192.168.70.106/flv/" fileU ".flv";
    	
    }
    	
    else {
    	
    	
    trace("FAILED");
    	
    }
    	
    trace("done");
    }
    function 
    securityErrorSend(e:SecurityErrorEvent):void {
    	
    trace('error: '+e);
    }
    function 
    ioErrorHandler(e:IOErrorEvent):void {
    	
    trace('error: '+e);
    }
    saveFunc();
    « Last Edit: 03/13/09, 12:02 by Jorge Solis »

    Jorge Solis

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 14616
      • View Profile
    In the IOError handler  (or even anywhere after sending the data) start a Timer that every 30 seconds call a function like this:


    function tryToPlay(evt:TimerEvent):void{
       try{
         
    flvPlayer.source "http://192.168.70.106/flv/" fileU ".flv";
      } catch(
    e:Error){
        
    trace("Failed to load")
     }
    }


    You need to use a listener callback from your flvPlayer (say onMetadata, don't remember exactly the flvPlayer callbacks) to cancel the timer (if the onMetadata callback is received, that means your flvPlayer success in the play)

    Jorge



    GavynE

    • Server what's that
    • *
    • Posts: 4
      • View Profile
      • Email
    Here is my code i updated and currently running tests with...

    there is a second timer on another layer its useless just records the length of how long the whole process takes me...

    var timeChk:Boolean = false;
    var timeCnt:Number = 0;
    var timeDelay:Number = 5;
    var file:String = "Snowmen.swf";
    var fileU:String = "someFlv";
    function saveFunc():void {
       addEventListener(Event.ENTER_FRAME, timer);
       var variables:URLVariables=new URLVariables();
       variables.file=file;
       variables.fileU=fileU;
       var richiesta:URLRequest=new URLRequest();
       richiesta.url=('http://192.168.70.106/convert.php');
       richiesta.method=URLRequestMethod.POST;
       richiesta.data=variables;
       var loader:URLLoader=new URLLoader();
       loader.dataFormat=URLLoaderDataFormat.BINARY;
       loader.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
       addLoaderListenersSend(loader);
       try {
          loader.load(richiesta);
       } catch (error:Error) {
          trace('Unable to load the document.');
       }
    }
    function addLoaderListenersSend(d:IEventDispatcher):void {
       d.addEventListener(Event.OPEN,inizioSend);
       d.addEventListener(ProgressEvent.PROGRESS,inProgressoSend);
       d.addEventListener(Event.COMPLETE,completatoSend);
       d.addEventListener(SecurityErrorEvent.SECURITY_ERROR,securityErrorSend);
    }
    function inizioSend(e:Event):void {
       trace('start');
    }
    function inProgressoSend(e:ProgressEvent):void {
       trace('Progress: '+e.bytesLoaded+' totale: '+e.bytesTotal);
    }
    function completatoSend(e:Event):void {
       trace("done");
       timeCnt = 0;
       addEventListener(Event.ENTER_FRAME, timerRe);
    }
    function securityErrorSend(e:SecurityErrorEvent):void {
       trace('error: '+e);
    }
    function ioErrorHandler(e:IOErrorEvent):void {
       trace('error: '+e);
    }
    //*********************************************************************
    function timerRe(e:Event):void {
       timeCnt++;
       if (timeCnt == timeDelay * 12) {
          timeCnt = 0;
          timeChk = true;
       } else {
          timeChk = false;
       }
       var variables:URLVariables=new URLVariables();
       variables.fileU=fileU;
       var richiesta:URLRequest=new URLRequest();
       richiesta.url=('http://192.168.70.106/filecheck.php');
       richiesta.method=URLRequestMethod.POST;
       richiesta.data=variables;
       var loaderRe:URLLoader=new URLLoader();
       loaderRe.dataFormat=URLLoaderDataFormat.BINARY;
       loaderRe.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandlerRe);
       addLoaderListenersSendRe(loaderRe);
       try {
          loaderRe.load(richiesta);
       } catch (error:Error) {
          trace('Unable to load the document.');
       }
    }
    function addLoaderListenersSendRe(d:IEventDispatcher):void {
       d.addEventListener(Event.OPEN,inizioSendRe);
       d.addEventListener(ProgressEvent.PROGRESS,inProgressoSendRe);
       d.addEventListener(Event.COMPLETE,completatoSendRe);
       d.addEventListener(SecurityErrorEvent.SECURITY_ERROR,securityErrorSendRe);
    }
    function inizioSendRe(e:Event):void {
       trace('startRe');
    }
    function inProgressoSendRe(e:ProgressEvent):void {
       trace('ProgressRe: '+e.bytesLoaded+' totale: '+e.bytesTotal);
    }
    function completatoSendRe(e:Event):void {
       trace("doneRe");
       removeEventListener(Event.ENTER_FRAME, timerRe);

       var vars:URLVariables=new URLVariables(e.target.data);
       trace(vars.conRe);
       if (vars.conRe == "1") {
          removeEventListener(Event.ENTER_FRAME, timer);
          flvPlayer.source = "http://192.168.70.106/flv/" + fileU + ".flv";
       } else {
          timeCnt = 0;
          addEventListener(Event.ENTER_FRAME, timerRe);
       }
    }
    function securityErrorSendRe(e:SecurityErrorEvent):void {
       trace('errorRe: '+e);
    }
    function ioErrorHandlerRe(e:IOErrorEvent):void {
       trace('errorRe: '+e);
    }
    saveFunc();

    GavynE

    • Server what's that
    • *
    • Posts: 4
      • View Profile
      • Email
    However i am still getting any error but i think it is because the first php doesn't send me any info and i think flash is waiting for something.

    Jorge Solis

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 14616
      • View Profile
    Use a sniffer to see back-end activity, I recomend http://www.charlesproxy.com

    Jorge