Class PlainSocket

java.lang.Object
java.net.Socket
com.enterprisedt.util.proxy.PlainSocket
All Implemented Interfaces:
StreamSocket, Closeable, AutoCloseable

public class PlainSocket extends Socket implements StreamSocket
Version:
$Revision$
Author:
$author$
  • Field Details

    • remoteHostname

      protected String remoteHostname
  • Constructor Details

    • PlainSocket

      public PlainSocket()
      Creates a new PlainSocket object.
      Throws:
      IOException
    • PlainSocket

      public PlainSocket(String host, int port) throws IOException
      Creates a new PlainSocket object.
      Parameters:
      host -
      port -
      Throws:
      IOException
    • PlainSocket

      public PlainSocket(InetAddress addr, int port) throws IOException
      Creates a new PlainSocket object.
      Parameters:
      addr -
      port -
      Throws:
      IOException
  • Method Details

    • isSecureMode

      public boolean isSecureMode()
      Is this socket in secure mode?
      Specified by:
      isSecureMode in interface StreamSocket
      Returns:
      true if secure mode
    • getRemoteHost

      public String getRemoteHost()
      Get the actual hostname
      Specified by:
      getRemoteHost in interface StreamSocket
      Returns:
      remote hostname
    • setRemoteHost

      public void setRemoteHost(String remoteHost)
      Set the remote hostname
      Specified by:
      setRemoteHost in interface StreamSocket
      Parameters:
      remoteHost - remote hostname
    • getDetail

      public String getDetail()
      Description copied from interface: StreamSocket
      Get details about the socket
      Specified by:
      getDetail in interface StreamSocket
      Returns:
    • createPlainSocket

      public static PlainSocket createPlainSocket(String host, int port, int timeout) throws 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:
      IOException
    • createPlainSocket

      public static PlainSocket createPlainSocket(InetAddress host, int port, int timeout) throws 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:
      IOException