Results 1 to 6 of 6

Thread: Flex FTP and socket error #2031

  1. #1
    Join Date
    Apr 2010
    Posts
    79

    Flex FTP and socket error #2031

    I am trying to create a FTP client in Flex/Air with socket. I am able to connect with the FTP server and grant. Then I moved to passive mode transferring the "PASV" FTP command.

    I received the data port on which I will send the files. And then I got the issues. I have create a new one socket that involves to connect on the port the server and suggests me, it means that still for some moments and provide me the socket error as #2031.I have explored the error message below with proper and complete error message :

    [IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2031: Socket Error URL: xx.xx.xx.xx" errorID=2031]

  2. #2
    Join Date
    Apr 2008
    Posts
    2,277

    Re: Flex FTP and socket error #2031

    There is some configuration here wanted to know about this. How many different FTP servers you are currently tried out with ? According to me, it seems issue within the FTP server side.. Will you please explore some more means the code that you are using currently. Please post the code that you are using currently..

  3. #3
    Join Date
    Apr 2010
    Posts
    79

    Re: Flex FTP and socket error #2031

    I search about this a lot on google but I didn't got anything which can be useful for me. Adobe Flex Socket reference (which doesn't even communicate about #2031 error message). I have also moved to perform FTP disk with the maliboo FTP lib but it seems the same as stated before.

    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" 
    layout="vertical" initialize="init()">
    <mx:Script>
        <![CDATA[
       
            private var sCmd:Socket
            private var sData:Socket
       
            private function init():void{
                sCmd=new Socket("xx.xx.xx.xx",21);
                sCmd.addEventListener(ProgressEvent.SOCKET_DATA,commandResponse)
                sCmd.addEventListener(IOErrorEvent.IO_ERROR, commandError);
                sCmd.writeUTFBytes("USER xxxxxx\n");
                    sCmd.flush();
                sCmd.writeUTFBytes("PASS xxxxxxx\n");
                sCmd.flush();
               sCmd.writeUTFBytes("CWD /mydirectory/\n");
                sCmd.flush();
                sCmd.writeUTFBytes("PASV\n");
                sCmd.flush();
                }
               
            private function commandResponse(e:ProgressEvent):void{
                var command_resp:String=sCmd.readUTFBytes(sCommand.bytesAvailable)
                if(command_resp.indexOf("227")>-1){
                 
                    var temp:String = command_resp.substring(command_resp.indexOf("(")+1,command_resp.indexOf(")"));
                    var data_channel_temp:Array = temp.split(",");
                    var data_channel_ip:String=data_channel_temp.slice(0,4).join('.')
                    var data_channel_port:int=parseInt(data_channel_temp[4])*256+parseInt(data_channel_ temp[5])
                    trace(data_channel_ip+" "+data_channel_port)
                     
                    sData=new Socket(data_channel_ip,data_channel_port)      
                    sData.addEventListener(ProgressEvent.SOCKET_DATA,dataResponse)
                    sData.addEventListener(IOErrorEvent.IO_ERROR, dataError);
                    }
                trace("command "+command_resp)
                }
               
            private function commandError(e:IOErrorEvent):void{
                trace("command -> "+e.text)
                }
               
            private function dataResponse(e:ProgressEvent):void{
                trace('data '+e)
                }
               
            private function dataError(e:IOErrorEvent):void{
                trace('data error ' +e)
                }
        ]]>
    </mx:Script>
    </mx:WindowedApplication>

  4. #4
    Join Date
    Apr 2010
    Posts
    59

    Re: Flex FTP and socket error #2031

    I am suffering with the exact same issue. I can't terminate the data connection here . Were you able to fix such type of issue ? I am working with filezila server. I required a 226 evaluation from the server to locate that the transfer is finished . If you are running with any inputs from your side maybe we can terminate our heads together.

  5. #5
    Join Date
    Apr 2010
    Posts
    79

    Re: Flex FTP and socket error #2031

    Unfortunately I was not capable to fix the issues . I have also opened so many ticket with my hosting, let them reconfigure the FTP server program (moved between pureFTP and proFTPd) but no way!

    Also, I have figured out that things started to getting failed when the hosting moved from a dedicated IP system to a shared IP system. While I was configuring up the ftp application and I tried to connect with the different hosting provider which uses the shared IP system and it got crash as well. My issue comes up when I try to move for a passive mode, it stands still for a while and it freezing with the fine socket error #2031. Hope to find out a fix for this !

  6. #6
    Join Date
    Apr 2010
    Posts
    59

    Re: Flex FTP and socket error #2031

    Fine, I am trying to work with the wireshark to find out what TCP/IP packets are getting tranferred and what entirely goion on now . I would suggest you the exact as well. Sleepless nights ahead . I have also queried about this to my seniors who have created the flex.

Similar Threads

  1. Flex Remoting Error : Channel Disconnected
    By Aaquib in forum Windows Software
    Replies: 5
    Last Post: 14-07-2010, 12:49 PM
  2. Unloadandstop error in fp10 / flex builder 3
    By Sargam in forum Windows Software
    Replies: 3
    Last Post: 10-07-2010, 01:30 PM
  3. Flex 3.4 SDK in Flex Builder 3 plug-in
    By Vivan in forum Software Development
    Replies: 5
    Last Post: 09-07-2010, 11:59 PM
  4. Winsock Socket error 10048 socket bind
    By Theophilus in forum Operating Systems
    Replies: 4
    Last Post: 16-02-2009, 08:07 PM
  5. Server Error: 451, Socket Error: 10053, Error Number: 0x800CCC0F
    By Eigenberg in forum Windows XP Support
    Replies: 3
    Last Post: 03-06-2008, 04:13 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,562,105.66072 seconds with 17 queries