This is my VS2008 project setup/configuration (on Vista Business x86 with 3GB RAM) -
- C# SmartDevice Project
- Targeting Windows Mobile 6 Professional SDK, .NETCF 3.5
- Running on Windows Mobile 6 Professional Emulator, data access via Cellular Emulator.
- Running on HTC Touch Cruise (WM 6.1), data acess via (valid) GPRS/3G.
Problem statement
- Timeout exception when calling .PutFile, .GetFile, .GetRawList, and etc.
- Problem happens when the FTP is going through GPRS connection, be it on real device or emulator (with Microsoft Cellular Emulator).
- Problem does not happen when the FTP is going through ActiveSync or WiFi connection, be it on on real device, or device emulator (with Microsoft Virtual PC 2007 network driver emulating WiFi).
Am I missing something somewhere? Any help is highly appreciated
Here is the code snippets in question (with details omitted for clarity) -
// Establish connection via Connection Manager (omitted)
.
.
// Connect to FTP server
Rebex.Net.Ftp Ftp = new Rebex.Net.Ftp();
Ftp.LogWriter =
new Rebex.FileLogWriter(@"\Storage Card\foo.log", Rebex.LogLevel.Debug);
Ftp.Connect("foohost.foodomain.com"); // success
Ftp.Login("foouser", "foopassword"); // success
// From here, calling .GetList, .PutFile, .GetFile(), and etc would cause
// timeout exception.
string[] X = Ftp.GetRawList(); // This will cause exception (timeout)
Ftp.PutFile("foo.zip", "\foo.zip"); // This will cause exception (timeout)
Here is the debug log created by the ILOG writer (for .GetRawList)
2010-07-28 03:28:14 Opening log file.
2010-07-28 03:28:17 INFO Ftp(1) Info: Connecting to mail2.iomentus.com:21 using Ftp 3.0.3843.0 (trial version).
2010-07-28 03:28:17 INFO Ftp(1) Info: Using proxy none.
2010-07-28 03:28:24 DEBUG Ftp(1) Info: Connection succeeded.
2010-07-28 03:28:24 INFO Ftp(1) Response: 220 Serv-U FTP Server v9.2 ready...
2010-07-28 03:28:25 INFO Ftp(1) Command: USER iss
2010-07-28 03:28:25 INFO Ftp(1) Response: 331 User name okay, need password.
2010-07-28 03:28:25 INFO Ftp(1) Command: PASS ****
2010-07-28 03:28:25 INFO Ftp(1) Response: 230 User logged in, proceed.
2010-07-28 03:28:25 INFO Ftp(1) Command: FEAT
2010-07-28 03:28:25 INFO Ftp(1) Response: 211-Extensions supported
2010-07-28 03:28:25 INFO Ftp(1) Response: UTF8
2010-07-28 03:28:25 INFO Ftp(1) Response: OPTS MODE;MLST;UTF8
2010-07-28 03:28:25 INFO Ftp(1) Response: CLNT
2010-07-28 03:28:25 INFO Ftp(1) Response: CSID Name; Version;
2010-07-28 03:28:25 INFO Ftp(1) Response: HOST domain
2010-07-28 03:28:25 INFO Ftp(1) Response: SITE PSWD;SET;ZONE;CHMOD;MSG;EXEC;HELP
2010-07-28 03:28:25 INFO Ftp(1) Response: AUTH TLS;SSL;TLS-C;TLS-P;
2010-07-28 03:28:25 INFO Ftp(1) Response: PBSZ
2010-07-28 03:28:25 INFO Ftp(1) Response: PROT
2010-07-28 03:28:25 INFO Ftp(1) Response: CCC
2010-07-28 03:28:25 INFO Ftp(1) Response: SSCN
2010-07-28 03:28:25 INFO Ftp(1) Response: RMDA directoryname
2010-07-28 03:28:25 INFO Ftp(1) Response: DSIZ
2010-07-28 03:28:25 INFO Ftp(1) Response: AVBL
2010-07-28 03:28:25 INFO Ftp(1) Response: MODE Z
2010-07-28 03:28:25 INFO Ftp(1) Response: THMB BMP|JPEG|GIF|TIFF|PNG max_width max_height pathname
2010-07-28 03:28:25 INFO Ftp(1) Response: REST STREAM
2010-07-28 03:28:25 INFO Ftp(1) Response: SIZE
2010-07-28 03:28:25 INFO Ftp(1) Response: MDTM
2010-07-28 03:28:25 INFO Ftp(1) Response: MDTM YYYYMMDDHHMMSS[+-TZ];filename
2010-07-28 03:28:25 INFO Ftp(1) Response: MFMT
2010-07-28 03:28:25 INFO Ftp(1) Response: MFCT
2010-07-28 03:28:25 INFO Ftp(1) Response: MFF Create;Modify;
2010-07-28 03:28:25 INFO Ftp(1) Response: XCRC filename;start;end
2010-07-28 03:28:25 INFO Ftp(1) Response: MLST Type*;Size*;Create;Modify*;Perm;Win32.ea;Win32.dt;Win32.dl
2010-07-28 03:28:25 INFO Ftp(1) Response: 211 End (for details use "HELP commmand" where command is the command of interest)
2010-07-28 03:28:26 INFO Ftp(1) Command: SYST
2010-07-28 03:28:26 INFO Ftp(1) Response: 215 UNIX Type: L8
2010-07-28 03:28:26 INFO Ftp(1) Command: OPTS UTF8 ON
2010-07-28 03:28:26 INFO Ftp(1) Response: 200 OPTS UTF8 is set to ON.
2010-07-28 03:28:27 DEBUG Ftp(1) Info: Starting data transfer.
2010-07-28 03:28:27 INFO Ftp(1) Command: TYPE A
2010-07-28 03:28:27 INFO Ftp(1) Response: 200 Type set to A.
2010-07-28 03:28:27 INFO Ftp(1) Command: PASV
2010-07-28 03:28:27 INFO Ftp(1) Response: 227 Entering Passive Mode (210,48,155,133,230,141)
2010-07-28 03:28:27 DEBUG Ftp(1) Info: Establishing data connection to 210.48.155.133:59021.
2010-07-28 03:28:28 DEBUG Ftp(1) Info: Enabling socket linger option.
2010-07-28 03:28:28 INFO Ftp(1) Command: LIST
2010-07-28 03:28:28 INFO Ftp(1) Response: 150 Opening ASCII mode data connection for /bin/ls.
2010-07-28 03:28:29 INFO Ftp(1) Response: 226 Transfer complete. 385 bytes transferred. 0.38 KB/sec.
2010-07-28 03:29:29 INFO Ftp(1) Info: Timing out.
2010-07-28 03:30:29 ERROR Ftp(1) Info: Error while reading data: Rebex.Net.FtpException: Timeout exceeded.
at Rebex.Net.Ftp.QztfFZ()
at wWGvS.bEcmRk.BMJzdYZ(Byte[] , Int32 , Int32 )
at wWGvS.bEcmRk.Read(Byte[] buffer, Int32 offset, Int32 count)
at wWGvS.bsWOwAZ.Read(Byte[] buffer, Int32 offset, Int32 count)
at Rebex.Net.Ftp.bjMtzmZ(String , Stream , Int64 , String )
at Rebex.Net.Ftp.GetRawList(String arguments, FtpListingType listingType)
at Rebex.Net.Ftp.GetRawList()
at SmartDeviceProject3.Form1..ctor()
at SmartDeviceProject3.Program.Main()
2010-07-28 03:30:29 ERROR Ftp(1) Info: Rebex.Net.FtpException: Timeout exceeded.
at Rebex.Net.Ftp.QztfFZ()
at wWGvS.bEcmRk.BMJzdYZ(Byte[] , Int32 , Int32 )
at wWGvS.bEcmRk.Read(Byte[] buffer, Int32 offset, Int32 count)
at wWGvS.bsWOwAZ.Read(Byte[] buffer, Int32 offset, Int32 count)
at Rebex.Net.Ftp.bjMtzmZ(String , Stream , Int64 , String )
at Rebex.Net.Ftp.GetRawList(String arguments, FtpListingType listingType)
at Rebex.Net.Ftp.GetRawList()
at SmartDeviceProject3.Form1..ctor()
at SmartDeviceProject3.Program.Main()
Thank you,
RKT.