Package com.enterprisedt.util.proxy
Class PlainSocket
java.lang.Object
java.net.Socket
com.enterprisedt.util.proxy.PlainSocket
- All Implemented Interfaces:
StreamSocket,Closeable,AutoCloseable
- Version:
- $Revision$
- Author:
- $author$
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new PlainSocket object.PlainSocket(String host, int port) Creates a new PlainSocket object.PlainSocket(InetAddress addr, int port) Creates a new PlainSocket object. -
Method Summary
Modifier and TypeMethodDescriptionstatic PlainSocketcreatePlainSocket(String host, int port, int timeout) Create a connected socket, using a timeout if it is available.static PlainSocketcreatePlainSocket(InetAddress host, int port, int timeout) Create a connected socket, using a timeout if it is available.Get details about the socketGet the actual hostnamebooleanIs this socket in secure mode?voidsetRemoteHost(String remoteHost) Set the remote hostnameMethods inherited from class java.net.Socket
bind, close, connect, connect, getChannel, getInetAddress, getInputStream, getKeepAlive, getLocalAddress, getLocalPort, getLocalSocketAddress, getOOBInline, getOption, getOutputStream, getPort, getReceiveBufferSize, getRemoteSocketAddress, getReuseAddress, getSendBufferSize, getSoLinger, getSoTimeout, getTcpNoDelay, getTrafficClass, isBound, isClosed, isConnected, isInputShutdown, isOutputShutdown, sendUrgentData, setKeepAlive, setOOBInline, setOption, setPerformancePreferences, setReceiveBufferSize, setReuseAddress, setSendBufferSize, setSocketImplFactory, setSoLinger, setSoTimeout, setTcpNoDelay, setTrafficClass, shutdownInput, shutdownOutput, supportedOptions, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.enterprisedt.util.proxy.StreamSocket
close, getInetAddress, getInputStream, getLocalAddress, getLocalPort, getOutputStream, getReceiveBufferSize, getSendBufferSize, getSoTimeout, isConnected, setReceiveBufferSize, setSendBufferSize, setSoTimeout
-
Field Details
-
remoteHostname
-
-
Constructor Details
-
PlainSocket
public PlainSocket()Creates a new PlainSocket object.- Throws:
IOException
-
PlainSocket
Creates a new PlainSocket object.- Parameters:
host-port-- Throws:
IOException
-
PlainSocket
Creates a new PlainSocket object.- Parameters:
addr-port-- Throws:
IOException
-
-
Method Details
-
isSecureMode
public boolean isSecureMode()Is this socket in secure mode?- Specified by:
isSecureModein interfaceStreamSocket- Returns:
- true if secure mode
-
getRemoteHost
Get the actual hostname- Specified by:
getRemoteHostin interfaceStreamSocket- Returns:
- remote hostname
-
setRemoteHost
Set the remote hostname- Specified by:
setRemoteHostin interfaceStreamSocket- Parameters:
remoteHost- remote hostname
-
getDetail
Description copied from interface:StreamSocketGet details about the socket- Specified by:
getDetailin interfaceStreamSocket- Returns:
-
createPlainSocket
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 toport- port on remote hosttimeout- 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 toport- port on remote hosttimeout- timeout in milliseconds on- Throws:
IOException
-