Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
7k views
in Java FTP by (420 points)
Hi,

I noticed that if server drops connection
and you use client.connected() it returns true.

How can I be sure that client is connected to server?


Br,

Juha

12 Answers

0 votes
by (420 points)
Hi,

So best way to check if connection is open,
is to use noOperation() method and if it throws
exception reconnect to server....

-Juha-
0 votes
by (162k points)
Yes, to be absolutely sure it is best to try an operation such as this.

Clients only really know if a server has gone away if they are reading or writing the socket that connects them.

Categories

...