Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
7k views
in Java FTP by (240 points)
Hi,
We were doing a stress test to upload files to an FTP server, uploading hundreds of files. Every time during the stress test, one file would fail to upload, and we got this exception:

com.enterprisedt.net.ftp.FTPException: OOPS: listen
at com.enterprisedt.net.ftp.FTPControlSocket.validateReply(FTPControlSocket.java:773)
at com.enterprisedt.net.ftp.FTPControlSocket.createDataSocketPASV(FTPControlSocket.java:494)
at com.enterprisedt.net.ftp.FTPControlSocket.createDataSocket(FTPControlSocket.java:364)
at com.enterprisedt.net.ftp.FTPClient.initPut(FTPClient.java:1344)
at com.enterprisedt.net.ftp.FTPClient.putData(FTPClient.java:1421)
at com.enterprisedt.net.ftp.FTPClient.putData(FTPClient.java:1401)
at com.enterprisedt.net.ftp.FTPClient.put(FTPClient.java:1227)
at com.enterprisedt.net.ftp.FTPClient.put(FTPClient.java:1195)

What does this mean and how do I resolve it?

Thank you very much in advance,
Eting

3 Answers

0 votes
by (162k points)
This is a message sent back from the FTP server. It could mean it failed to open a listening socket.

If you are uploading hundreds of files, because FTP uses a new socket connection for each transfer, you'll eventually run out of sockets and have to pause the transfers for a little while to free them up. See the documentation or google for TIME_WAIT.
0 votes
by (240 points)
Thanks, this makes sense.

Is there anything I can do through the software? For example:

if (out_of_sockets)
{
wait_a_bit
}
else
{
continue_uploading..
}

I mean, are there any functions or methods I can use from the Edtftp packages?

Thanks a lot,
Elaine
0 votes
by (162k points)
One common approach is to catch IOException (which generally means this problem has occurred), wait for maybe 10-30s, and then resume your transfers. This gives time for the operating system to free up sockets in TIME_WAIT.

Categories

...