Package com.enterprisedt.util.proxy
Interface StreamSocket
- All Known Implementing Classes:
PlainSocket
public interface StreamSocket
Interface of all stream sockets
- Version:
- $Revision$
- Author:
- $author$
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Close the socketGet details about the socketReturns the address to which the socket is connected.Get the socket's input streamGets the local address to which the socket is bound.intReturns the local port to which this socket is bound.Get the socket's output streamintGets the value of SO_RCVBUFGet the actual hostnameintGet value of the SO_SNDBUF optionintReturns setting for SO_TIMEOUT.booleanIs the socket connected?booleanIs this socket in secure mode?voidsetReceiveBufferSize(int size) Sets the SO_RCVBUF optionvoidsetRemoteHost(String remoteHost) Set the remote hostnamevoidsetSendBufferSize(int size) Sets the SO_SNDBUF optionvoidsetSoTimeout(int timeout) Enable/disable SO_TIMEOUT with the specified timeout, in milliseconds.
-
Method Details
-
close
Close the socket- Throws:
IOException
-
isConnected
boolean isConnected()Is the socket connected?- Returns:
-
getInputStream
Get the socket's input stream- Returns:
- stream
- Throws:
IOException
-
setSoTimeout
Enable/disable SO_TIMEOUT with the specified timeout, in milliseconds.- Parameters:
timeout-- Throws:
SocketException
-
getSoTimeout
Returns setting for SO_TIMEOUT.- Throws:
SocketException
-
getOutputStream
Get the socket's output stream- Returns:
- stream
- Throws:
IOException
-
getLocalAddress
InetAddress getLocalAddress()Gets the local address to which the socket is bound.- Returns:
- the local address
-
getLocalPort
int getLocalPort()Returns the local port to which this socket is bound.- Returns:
- the local port
-
getInetAddress
InetAddress getInetAddress()Returns the address to which the socket is connected.- Returns:
- the remote IP address
-
getRemoteHost
String getRemoteHost()Get the actual hostname- Returns:
- remote hostname
-
setRemoteHost
Set the remote hostname- Parameters:
remoteHost- remote hostname
-
getReceiveBufferSize
Gets the value of SO_RCVBUF- Throws:
SocketException
-
setReceiveBufferSize
Sets the SO_RCVBUF option- Throws:
SocketException
-
setSendBufferSize
Sets the SO_SNDBUF option- Throws:
SocketException
-
getSendBufferSize
Get value of the SO_SNDBUF option- Throws:
SocketException
-
isSecureMode
boolean isSecureMode()Is this socket in secure mode?- Returns:
- true if secure mode
-
getDetail
String getDetail()Get details about the socket- Returns:
-