Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.enterprisedt.net.ftp
Class SocketUtils

    java.lang.Object
      com.enterprisedt.net.ftp.SocketUtils

    public class SocketUtils

extends java.lang.Object

Utility class that allows 1.4 socket methods to be called while still being able to be compiled in 1.1.x

Version:
  $Revision: 1.5 $
Author:
  Bruce Blackshaw

Constructor Summary
`SocketUtils()`

Method Summary
`static java.net.Socket` | `createSocket(java.net.InetAddress host, int port, int timeout)` Create a connected socket, using a timeout if it is available.
`static boolean` | `isConnected(java.net.Socket sock)` Test if a socket is connected by using the isConnected method, only available from JRE 1.4+.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### SocketUtils

    public SocketUtils()

Method Detail

### createSocket

    public static java.net.Socket createSocket(java.net.InetAddress host,
                                               int port,
                                               int timeout)
                                        throws java.io.IOException

  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
    `port` - port on remote host
    `timeout` - timeout in milliseconds on
  Throws:
    `java.io.IOException`

### isConnected

    public static boolean isConnected(java.net.Socket sock)
                               throws java.io.IOException

  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
  Throws:
    `java.io.IOException`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright (c) 2001-2007 Enterprise Distributed Technologies Ltd. All Rights Reserved.