| java.lang.Object com.enterprisedt.net.ftp.SocketUtils
SocketUtils | public class SocketUtils (Code) | | Utility class that allows 1.4 socket methods to be called while
still being able to be compiled in 1.1.x
author: Bruce Blackshaw version: $Revision: 1.5 $ |
Method Summary | |
public static Socket | createSocket(InetAddress host, int port, int timeout) Create a connected socket, using a timeout if it is available. | public static boolean | isConnected(Socket sock) Test if a socket is connected by using the isConnected method, only
available from JRE 1.4+. |
createSocket | public static Socket createSocket(InetAddress host, int port, int timeout) throws IOException(Code) | | Create a connected socket, using a timeout if it is available.
Availability is tested by trying to create instances of the
required classes and methods (JRE 1.4+)
Parameters: host - remote host to connect to Parameters: port - port on remote host Parameters: timeout - timeout in milliseconds on exception: IOException - |
isConnected | public static boolean isConnected(Socket sock) throws IOException(Code) | | Test if a socket is connected by using the isConnected method, only
available from JRE 1.4+. So invoke using reflection. If can't check
it assumes the socket is connected.
Parameters: sock - socket to test exception: IOException - |
|
|