Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
3.5k views
in .NET FTP by (160 points)
Perhaps this problem has been posted before.

When I execute system() command of com.enterprisedt.net.ftp.FTPClient, it never returns. The thread blocks indefinitely. Lets assume the server doesn't respond. Isn't the libary supposed to time it out? My FTP server is a standard Solaris, Unix. Below are relevant details

------------------------------
---- My code - simlpe one line ----
ftp.system();

------------------------------
---- FTP commands log ----
[FTP Reply] 227 Entering Passive Mode (192,165,218,13,33,80)
[FTP Command] ---> SYST
[FTP Reply] 150 Data connection accepted from 169.196.240.2:16224; transfer starting.
[FTP Command] ---> SYST

------------------------------
---- Stack trace where it blocks. Read from the bottom up, my class is frame #13 ----
Frame:=1, File:=SocketInputStream.java, class:=java.net.SocketInputStream, method:=socketRead0, line:=-2
Frame:=2, File:=SocketInputStream.java, class:=java.net.SocketInputStream, method:=read, line:=129
Frame:=3, File:=StreamDecoder.java, class:=sun.nio.cs.StreamDecoder$CharsetSD, method:=readBytes, line:=411
Frame:=4, File:=StreamDecoder.java, class:=sun.nio.cs.StreamDecoder$CharsetSD, method:=implRead, line:=453
Frame:=5, File:=StreamDecoder.java, class:=sun.nio.cs.StreamDecoder, method:=read, line:=183
Frame:=6, File:=InputStreamReader.java, class:=java.io.InputStreamReader, method:=read, line:=167
Frame:=7, File:=BufferedReader.java, class:=java.io.BufferedReader, method:=fill, line:=136
Frame:=8, File:=BufferedReader.java, class:=java.io.BufferedReader, method:=readLine, line:=299
Frame:=9, File:=BufferedReader.java, class:=java.io.BufferedReader, method:=readLine, line:=362
Frame:=10, File:=FTPControlSocket.java, class:=com.enterprisedt.net.ftp.FTPControlSocket, method:=readReply, line:=558
Frame:=11, File:=FTPControlSocket.java, class:=com.enterprisedt.net.ftp.FTPControlSocket, method:=sendCommand, line:=526
Frame:=12, File:=FTPClient.java, class:=com.enterprisedt.net.ftp.FTPClient, method:=system, line:=2173
Frame:=13, File:=FtpConManager.java, class:=com.ealeksandrov.ftp.FtpConManager, method:=issue_system, line:=231

3 Answers

0 votes
by (162k points)
Why is system() being called here? It looks like a transfer is being started.
0 votes
by (160 points)
No, it is the system() command. I am not sure why the log says transfer started...perhaps data port is opened for SYST response? It's your logReply() method.
All I know is FTP server was overloaded at that time and never responded even after load easyed up hours later.

I could deal with it by setting socket.setSoTimeout(ms) which forces a reconnect. But I still wonder why the server did not respond to a simple command.
0 votes
by (162k points)
Use setTimeout(60000) to set the timeout to 60 s

Categories

...