|
Sun Adapter for Batch/FTP | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.net.Socket
com.stc.eways.batchext.SocksSocket
public class SocksSocket
This class represents a socket through the SOCKS server.
Constructor Summary | |
---|---|
SocksSocket(java.net.InetAddress remoteIP,
int remotePort)
Constructor. |
|
SocksSocket(java.net.InetAddress remoteIP,
int remotePort,
java.net.InetAddress localIP,
int localPort)
Constructor. |
|
SocksSocket(java.net.InetAddress remoteIP,
int remotePort,
java.net.InetAddress localIP,
int localPort,
SocksChain socksList)
Constructor. |
|
SocksSocket(java.net.InetAddress remoteIP,
int remotePort,
SocksChain socksList)
Constructor.* Creates a data-stream socket and connects it to the specified port number* at the specified IP address.* @param socksList Represents a SOCKS server chain.* @param remoteIP The IP address of the remote host to connect to.* @param remotePort The port number to connect to on remote host.* @throws SocksException If something is wrong with SOCKS.* @throws IOException If an input-output error occurs when creating the socket. |
|
SocksSocket(Socks socks,
java.net.InetAddress remoteIP,
int remotePort)
Constructor. |
|
SocksSocket(Socks socks,
java.net.InetAddress remoteIP,
int remotePort,
java.net.InetAddress localIP,
int localPort)
Constructor. |
|
SocksSocket(Socks socks,
java.lang.String remoteHost,
int remotePort)
Constructor. |
|
SocksSocket(Socks socks,
java.lang.String remoteHost,
int remotePort,
java.net.InetAddress localIP,
int localPort)
Constructor. |
|
SocksSocket(java.lang.String remoteHost,
int remotePort)
Constructor. |
|
SocksSocket(java.lang.String remoteHost,
int remotePort,
java.net.InetAddress localIP,
int localPort)
Constructor. |
|
SocksSocket(java.lang.String remoteHost,
int remotePort,
java.net.InetAddress localIP,
int localPort,
SocksChain socksList)
Constructor. |
|
SocksSocket(java.lang.String remoteHost,
int remotePort,
SocksChain socksList)
Constructor. |
Method Summary | |
---|---|
void |
close()
Closes the current socket. |
java.net.InetAddress |
getInetAddress()
Retrieves the address to which the current socket is connected. |
java.io.InputStream |
getInputStream()
Returns an input stream for the current socket. |
boolean |
getKeepAlive()
Tests whether the SO_KEEPALIVE option is enabled. |
java.net.InetAddress |
getLocalAddress()
Gets the local address to which the current socket is bound. |
int |
getLocalPort()
Returns the local port to which the current socket is bound. |
java.io.OutputStream |
getOutputStream()
Returns an output stream for the current socket. |
int |
getPort()
Returns the remote port to which the current socket is connected. |
int |
getReceiveBufferSize()
Gets the value of the SO_RCVBUF option for the current socket, that is the buffer size used by the platform for input on this socket. |
int |
getSendBufferSize()
Gets the value of the SO_SNDBUF option for the current socket, that is, the buffer size used by the platform for output on the current socket. |
Socks |
getSocks()
Returns the SOCKS server to which the socket is connected. |
SocksChain |
getSocksList()
Returns the SOCKS chain to which the current socket is connected. |
int |
getSoLinger()
Gets the setting for the SO_LINGER option. |
int |
getSoTimeout()
Gets the setting for the SO_TIMEOUT option. |
boolean |
getTcpNoDelay()
Tests whether the TCP_NODELAY option is enabled. |
static void |
main(java.lang.String[] args)
Used to do stand-alone testing. |
void |
setKeepAlive(boolean on)
Allows you to enable or disable the SO_KEEPALIVE option. |
void |
setReceiveBufferSize(int size)
Sets the SO_RCVBUF option to the specified value for the current DatagramSocket. |
void |
setSendBufferSize(int size)
Sets the SO_SNDBUF option to the specified value for the current DatagramSocket. |
static void |
setSocketImplFactory(java.net.SocketImplFactory factory)
Sets the client socket implementation factory for the current application. |
void |
setSoLinger(boolean on,
int linger)
Allows you to enable or disable the SO_LINGER option, using the specified linger time, in seconds. |
void |
setSoTimeout(int timeout)
Allows you to enable or disable the SO_TIMEOUT option, using the specified timeout, in milliseconds. |
void |
setTcpNoDelay(boolean on)
Allows you to enable or disable TCP_NODELAY (Nagle's algorithm). |
void |
shutdownInput()
Places the input data stream for the current socket at the "end of the stream." Any data sent to the input stream side of a socket is acknowledged, then silently discarded. |
void |
shutdownOutput()
Disables the output data stream for the current socket. |
java.lang.String |
toString()
Converts the current socket to a String . |
Methods inherited from class java.net.Socket |
---|
bind, connect, connect, getChannel, getLocalSocketAddress, getOOBInline, getRemoteSocketAddress, getReuseAddress, getTrafficClass, isBound, isClosed, isConnected, isInputShutdown, isOutputShutdown, sendUrgentData, setOOBInline, setPerformancePreferences, setReuseAddress, setTrafficClass |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SocksSocket(Socks socks, java.lang.String remoteHost, int remotePort, java.net.InetAddress localIP, int localPort) throws SocksException, java.net.UnknownHostException, java.io.IOException
socks
- Represent a SOCKS server.remoteHost
- The remote host to connect to.remotePort
- The port number to connect to on the remote host.localIP
- The IP address of the local host that the socket is bound to.localPort
- The local port (on the local host) that the socket is bound to.
SocksException
- If something is wrong with SOCKS.
java.net.UnknownHostException
- If the IP address of the host cannot be determined.
java.io.IOException
- If an input-output error occurs when creating the socket.public SocksSocket(Socks socks, java.net.InetAddress remoteIP, int remotePort, java.net.InetAddress localIP, int localPort) throws SocksException, java.io.IOException
socks
- Represent a SOCKS server.remoteIP
- The IP address of the remote host to connect to.remotePort
- The port number to connect to on the remote host.localIP
- The IP address of the local host that the socket is bound to.localPort
- The local port on the local host that the socket is bound to.
SocksException
- If something is wrong with SOCKS.
java.io.IOException
- If an input-output error occurs when creating the socket.public SocksSocket(Socks socks, java.net.InetAddress remoteIP, int remotePort) throws SocksException, java.io.IOException
socks
- Represent a SOCKS server.remoteIP
- The IP address of the remote host to connect to.remotePort
- The port number to connect to on the remote host.
SocksException
- If something is wrong with SOCKS.
java.io.IOException
- If an input-output error occurs when creating the socket.public SocksSocket(Socks socks, java.lang.String remoteHost, int remotePort) throws SocksException, java.net.UnknownHostException, java.io.IOException
socks
- Represent a SOCKS server.remoteHost
- The remote host to connect to.remotePort
- The port number to connect to on the remote host.
SocksException
- If something is wrong with SOCKS.
java.net.UnknownHostException
- If the IP address of the host cannot be determined.
java.io.IOException
- If an input-output error occurs when creating the socket.public SocksSocket(java.lang.String remoteHost, int remotePort) throws SocksException, java.net.UnknownHostException, java.io.IOException
remoteHost
- The remote host to connect to.remotePort
- The port number to connect to on the remote host.
SocksException
- If something is wrong with SOCKS.
java.net.UnknownHostException
- If the IP address of the host cannot be determined.
java.io.IOException
- If an input-output error occurs when creating the socket.public SocksSocket(java.lang.String remoteHost, int remotePort, java.net.InetAddress localIP, int localPort) throws SocksException, java.net.UnknownHostException, java.io.IOException
remoteHost
- The remote host to connect to.remotePort
- The port number to connect to on the remote host.localIP
- The IP address of the local host that the socket is bound to.localPort
- The local port on the local host that the socket is bound to.
SocksException
- If something is wrong with SOCKS.
java.net.UnknownHostException
- If the IP address of the host cannot be determined.
java.io.IOException
- If an input-output error occurs when creating the socket.public SocksSocket(java.net.InetAddress remoteIP, int remotePort) throws SocksException, java.io.IOException
remoteIP
- The IP address of the remote host to connect to.remotePort
- The port number to connect to on the remote host.
SocksException
- If something is wrong with SOCKS.
java.io.IOException
- If an input-output error occurs when creating the socket.public SocksSocket(java.net.InetAddress remoteIP, int remotePort, java.net.InetAddress localIP, int localPort) throws SocksException, java.io.IOException
remoteIP
- The IP address of the remote host to connect to.remotePort
- The port number to connect to on the remote host.localIP
- The IP address of the local host that the socket is bound to.localPort
- The local port on the local host that the socket is bound to.
SocksException
- If something is wrong with SOCKS.
java.io.IOException
- If an input-output error occurs when creating the socket.public SocksSocket(java.lang.String remoteHost, int remotePort, SocksChain socksList) throws SocksException, java.net.UnknownHostException, java.io.IOException
socksList
- Represents a SOCKS server chain.remoteHost
- The remote FTP host to connect to.remotePort
- The port number to connect to on remote host.
SocksException
- If something is wrong with SOCKS.
java.net.UnknownHostException
- If the IP address of the host could not be determined.
java.io.IOException
- If an input-output error occurs when creating the socket.public SocksSocket(java.lang.String remoteHost, int remotePort, java.net.InetAddress localIP, int localPort, SocksChain socksList) throws SocksException, java.net.UnknownHostException, java.io.IOException
socksList
- Represents a SOCKS server chain.remoteHost
- The remote host to connect to.remotePort
- The port number to connect to on remote host.localIP
- The IP address of the local host that the socket is bound to.localPort
- The local port (on the local host) that the socket is bound to.
SocksException
- If something is wrong with SOCKS.
java.net.UnknownHostException
- If the IP address of the host could not be determined.
java.io.IOException
- If an input-output error occurs when creating the socket.public SocksSocket(java.net.InetAddress remoteIP, int remotePort, SocksChain socksList) throws SocksException, java.io.IOException
SocksException
java.io.IOException
public SocksSocket(java.net.InetAddress remoteIP, int remotePort, java.net.InetAddress localIP, int localPort, SocksChain socksList) throws SocksException, java.io.IOException
socksList
- Represents a SOCKS server chain.remoteIP
- The IP address of the remote host to connect to.remotePort
- The port number to connect to on remote host.localIP
- The IP address of the local host that the socket is bound to.localPort
- The local port (on the local host) that the socket is bound to.
SocksException
- If something is wrong with SOCKS.
java.io.IOException
- If an input-output error occurs when creating the socket.Method Detail |
---|
public static void setSocketImplFactory(java.net.SocketImplFactory factory) throws java.io.IOException
factory
- The desired factory.
java.io.IOException
- If an input-output error occurs when setting the
socket factory.public void close() throws java.io.IOException
close
in class java.net.Socket
java.io.IOException
- If an input-output error occurs when closing the current socket.public java.net.InetAddress getInetAddress()
getInetAddress
in class java.net.Socket
public java.io.InputStream getInputStream() throws java.io.IOException
getInputStream
in class java.net.Socket
java.io.IOException
- If an input-output error occurs when creating the input stream.public java.net.InetAddress getLocalAddress()
getLocalAddress
in class java.net.Socket
public int getLocalPort()
getLocalPort
in class java.net.Socket
public java.io.OutputStream getOutputStream() throws java.io.IOException
getOutputStream
in class java.net.Socket
java.io.IOException
- If an input-output error occurs when creating the output stream.public int getPort()
getPort
in class java.net.Socket
public int getReceiveBufferSize() throws java.net.SocketException
getReceiveBufferSize
in class java.net.Socket
java.net.SocketException
- If there is an error in the underlying protocol, such as a TCP error.public int getSendBufferSize() throws java.net.SocketException
getSendBufferSize
in class java.net.Socket
java.net.SocketException
- If there is an error in the underlying protocol, such as a TCP error.public int getSoLinger() throws java.net.SocketException
getSoLinger
in class java.net.Socket
java.net.SocketException
- If there is an error in the underlying protocol, such as a TCP error.public int getSoTimeout() throws java.net.SocketException
getSoTimeout
in class java.net.Socket
java.net.SocketException
- If there is an error in the underlying protocol, such as a TCP error.public boolean getTcpNoDelay() throws java.net.SocketException
getTcpNoDelay
in class java.net.Socket
java.net.SocketException
- If there is an error in the underlying protocol, such as a TCP error.public void setReceiveBufferSize(int size) throws java.net.SocketException
Increasing the buffer size can improve the performance of network input-output for a high-volume connection. However, decreasing the size can help reduce the backlog of incoming data. For UDP, this method sets the maximum size of a packet that can be sent on the current socket.
Because SO_RCVBUF is a hint, applications that want to
verify what size the buffers were set to must call
setReceiveBufferSize
in class java.net.Socket
size
- The size to use in setting the receive buffer.
size. This value must be greater than zero.
java.lang.IllegalArgumentException
- If the value is zero or negative.
java.net.SocketException
- If there is an error in the underlying protocol, such as a TCP error.
public void setSendBufferSize(int size) throws java.net.SocketException
Increasing the buffer size can improve the performance of network input-output for a high-volume connection. However, decreasing the size can help reduce the backlog of incoming data. For UDP, this method sets the maximum size of a packet that can be sent on the current socket.
Because SO_SNDBUF is a hint, applications that want to
verify what size the buffers were set to must call
setSendBufferSize
in class java.net.Socket
size
- The size to which to set the send buffer.
size. This value must be greater than zero.
java.lang.IllegalArgumentException
- If the value is zero or negative.
java.net.SocketException
- If there is an error in the underlying protocol, such as a TCP error.
public void setSoLinger(boolean on, int linger) throws java.net.SocketException
setSoLinger
in class java.net.Socket
on
- Enables the SO_LINGER option.linger
- How long to linger, if SO_LINGER is enabled.
java.lang.IllegalArgumentException
- If the linger value is negative.
java.net.SocketException
- If there is an error in the underlying protocol, such as a TCP error.public void setSoTimeout(int timeout) throws java.net.SocketException
setSoTimeout
in class java.net.Socket
timeout
- The timeour time, in milliseconds (an integer).
java.net.SocketException
- If there is an error in the underlying protocol, such as a TCP error.public void setTcpNoDelay(boolean on) throws java.net.SocketException
setTcpNoDelay
in class java.net.Socket
on
- true or false.
java.net.SocketException
- If there is an error in the underlying protocol, such as a TCP error.public java.lang.String toString()
String
.
toString
in class java.net.Socket
public boolean getKeepAlive() throws java.net.SocketException
getKeepAlive
in class java.net.Socket
java.net.SocketException
- If there is an error in the underlying protocol, such as a TCP error.public void setKeepAlive(boolean on) throws java.net.SocketException
setKeepAlive
in class java.net.Socket
on
- true or false.
java.net.SocketException
- If there is an error in the underlying protocol, such as a TCP error.public void shutdownInput() throws java.io.IOException
shutdownInput
in class java.net.Socket
java.io.IOException
- If an input-output error occurs when shutting down the current socket.public void shutdownOutput() throws java.io.IOException
shutdownOutput
in class java.net.Socket
java.io.IOException
- If an input-output error occurs when shutting down the current socket.public static void main(java.lang.String[] args)
args
- Command line parameters.public Socks getSocks()
public SocksChain getSocksList()
|
Sun Adapter for Batch/FTP | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |