I assume you are referring to Commons NET here. You should probably use isAvailable() instead as that performs more checks.
However as the method Javadoc says, the only sure way to check if the connection is still available is to use it. Commons NET does not provide idle connection checking and so there is no event for it. You will need to implement your own checks, e.g. using sendNoOp() every so often. Care must be taken to ensure that you only send such probes when the connnection is not being used otherwise you might interfere with other commands. Note that Commons NET is only intended to provide basic access to Internet protocols. For example it is not intended to replace a full FTP Client, merely to provide some building blocks. On 11 May 2016 at 15:09, Mailing User <mailingl...@mail.com> wrote: > I think the connection to a FTP server can be lost. Reasons can be, network > disconnection or client idling. > > If that happens, can I be notified of the disconnection? I cannot find any > "event" for that. Should I keep polling the state by periodically calling > "isConnected()"? > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscr...@commons.apache.org > For additional commands, e-mail: user-h...@commons.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@commons.apache.org For additional commands, e-mail: user-h...@commons.apache.org