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 :
Quote:
[IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2031: Socket Error URL: xx.xx.xx.xx" errorID=2031]
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..
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>
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.
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 !
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.