I'm new to this list and wondered if anyone can help. I've been using the
commons net package 1.1.0. I have an ftp client program that uses this
package and is continuously active. It has 5 or 6 different threads each of
which queries different directories on an FTP server. Each thread has a
separate FtpClient instance. A thread wakes up after 5 minutes, gets a new
FtpClient connection and attempts to copy any new files it finds posted in
its directory. It then disconnects (within a finally statement)
irrespective of whether it got errors.
What I find is that after some time of running (sometimes 2-3 days,
sometimes 2-3 weeks) I can no longer get a connection. I see:
java.net.SocketException: No buffer space available (maximum connections
reached?): JVM_Bind
at java.net.PlainSocketImpl.socketBind(Native Method)
at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:331)
at java.net.Socket.bind(Socket.java:498)
at java.net.Socket.<init>(Socket.java:307)
at java.net.Socket.<init>(Socket.java:124)
at
org.apache.commons.net.DefaultSocketFactory.createSocket(DefaultSocketFactor
y.java:92)
at
org.apache.commons.net.SocketClient.connect(SocketClient.java:201)
at
org.apache.commons.net.SocketClient.connect(SocketClient.java:289)
at com.sis.ftpdupit.FtpWorker.syncFiles(Unknown Source)
at com.sis.ftpdupit.FtpWorker.run(Unknown Source)
I cannot see from my code how it would ever fail to call
FtpClient.disconnect(). Can anyone help? (Incidentally, from today I am
investigating the current 1.2.2 release in the hope that such a problem
might have been corrected there). Thanks in advance,
John Watson
**************************************************************************
Satellite Information Services Limited Registered Office:
17 Corsham Street London N1 6DR, Company No. 4243307
The information in this e-mail (which includes any files
transmitted with it) is confidential and may also be legally
privileged. It is intended for the addressee only. Access to
this e-mail by anyone else is unauthorised. It is not to be
relied upon by any person other than the addressee except
with prior written approval of an authorised representative of
SIS. If no such approval is given, SIS will not accept any
liability (in negligence or otherwise) arising from any third
party acting, or refraining from acting, on such information.
Unauthorised recipients are required to maintain confidentiality.
If you have received this e-mail in error please notify the
sender immediately, destroy any copies and delete it from your
computer system.
**************************************************************************