Đã Đóng

AS3 Socket FTP over a 3G network

I have an AS3 socket script to connect and retrieve data from a FTP account.

It works fine when the device is connected to a WIFI or LAN network. The problem is that when the device is connected to a 3G network the my script fails 90% of the times. There must be some kind of DATA LOSS.

I need to detect that data loss and send data to the server again.

If you think you can do that then contact me.

Here's my code:

import [url removed, login to view];

import [url removed, login to view];

import [url removed, login to view];

import [url removed, login to view];

import [url removed, login to view];

//

var ftp_host:String="[url removed, login to view]";

var ftp_port:Number=21//or your ftp port;

var ftp_username:String="username";

var ftp_password:String="password";

var ftp_path:String="/";

var s,r;

var listOfFiles:Array;

//

readFromFTP()

function readFromFTP(e=null){

s = new Socket(ftp_host,ftp_port);

r = new Socket();

[url removed, login to view](IOErrorEvent.IO_ERROR,onIOERR);

[url removed, login to view](ProgressEvent.SOCKET_DATA, onReturnData);

[url removed, login to view](SecurityErrorEvent.SECURITY_ERROR,onSecERR);

[url removed, login to view](ProgressEvent.SOCKET_DATA, onServData);

[url removed, login to view]([url removed, login to view], onPasvConn);

[url removed, login to view](IOErrorEvent.IO_ERROR,onIOERR);

[url removed, login to view](SecurityErrorEvent.SECURITY_ERROR,onSecERR);

[url removed, login to view](UncaughtErrorEvent.UNCAUGHT_ERROR, handleGlobalErrors);

}

function onReturnData(evt:ProgressEvent)

{

var d = [url removed, login to view]([url removed, login to view]);

trace(d);

[url removed, login to view](d);

if([url removed, login to view]("220 ")>-1){

[url removed, login to view]("Username sent\n");

[url removed, login to view]("USER "+ftp_username+"\n");

[url removed, login to view]()

}

if([url removed, login to view]("331 ")>-1){

[url removed, login to view]("Password sent\n");

[url removed, login to view]("PASS "+ftp_password+"\n");

[url removed, login to view]()

}

if ([url removed, login to view]("230") > -1)

{

[url removed, login to view]("PASV command sent\n");

[url removed, login to view]("PASV \n");

[url removed, login to view]();

}

var a = [url removed, login to view]('227');

if (a > -1)

{

var st = [url removed, login to view]("(",a);

var en = [url removed, login to view](")",a);

var str;

str = [url removed, login to view](st + 1,en);

var a2 = [url removed, login to view](",");

var p1 = [url removed, login to view]();

var p2 = [url removed, login to view]();

var ip:String = [url removed, login to view](".");

var port:int=(p2*256)+(p1*1);

[url removed, login to view](ip, port);

}

if([url removed, login to view]("226 ")>-1){

[url removed, login to view]("QUIT command sent\n");

[url removed, login to view]("QUIT \n");

[url removed, login to view]();

}

if([url removed, login to view]("221 ")>-1){

}

}

function onPasvConn(evt:Event):void

{

//trace("CONNECTED TO DATA PORT");

[url removed, login to view]("CONNECTED TO DATA PORT\n");

[url removed, login to view]("NLST "+ftp_path+"\n");

[url removed, login to view]();

}

function onServData(evt:ProgressEvent):void

{

var d = [url removed, login to view]([url removed, login to view]);

trace(d);

[url removed, login to view](d);

}

function onIOERR(evt:IOErrorEvent)

{

trace([url removed, login to view]+":"+[url removed, login to view]);

[url removed, login to view]([url removed, login to view]+":"+[url removed, login to view]);

}

function onSecERR(evt){

[url removed, login to view]("Security error\n");

}

function handleGlobalErrors(evt){

[url removed, login to view]("Unhandeled Error\n");

}

Kỹ năng: ActionScript, Android, Mobile App Development

Xem thêm: ftp data loss, text wifi android, substring c, string problem, flash mobile account number, event connect, e network, data str, c substring, string substring, connect android wifi, as3 or, as3 0, android string, need flash phone, void, str, socket server, r network, over ip, network security, need new security code, detect mobile, as3, android security

Về Bên Thuê:
( 3 nhận xét ) Linköping, Sweden

Mã Dự Án: #1691256

3 freelancer đang chào giá trung bình $210 cho công việc này

rikgjhu

PLEASE CHECK PM

$180 USD trong 3 ngày
(0 Đánh Giá)
0.0
A4IZbKz69

Custom Software Development - <b><i>Removed by Admin</i></b>

$250 USD trong 1 ngày
(0 Đánh Giá)
0.0
crimus

Please check the your PM.

$200 USD trong 2 ngày
(0 Đánh Giá)
0.0