
Public Member Functions | |
| void | clearEOL () throws IOException |
| SocketChannel | getChannel () |
| String | getHost () |
| int | hashCode () |
| int | read (byte[] b) throws IOException |
| String | readLine () throws IOException |
| SockIO (SockIOPool pool, String host, int timeout, int connectTimeout, boolean noDelay) throws IOException, UnknownHostException | |
| SockIO (SockIOPool pool, String host, int port, int timeout, int connectTimeout, boolean noDelay) throws IOException, UnknownHostException | |
| String | toString () |
| void | trueClose (boolean addToDeadPool) throws IOException |
| void | trueClose () throws IOException |
Protected Member Functions | |
| void | finalize () throws Throwable |
Static Protected Member Functions | |
| static Socket | getSocket (String host, int port, int timeout) throws IOException |
Package Functions | |
| void | close () |
| void | flush () throws IOException |
| boolean | isAlive () |
| boolean | isConnected () |
| void | write (byte[] b) throws IOException |
Private Attributes | |
| String | host |
| DataInputStream | in |
| BufferedOutputStream | out |
| SockIOPool | pool |
| Socket | sock |
Static Private Attributes | |
| static Logger | log |
This class is a wrapper around a Socket and its streams.
| SockIO | ( | SockIOPool | pool, | |
| String | host, | |||
| int | port, | |||
| int | timeout, | |||
| int | connectTimeout, | |||
| boolean | noDelay | |||
| ) | throws IOException, UnknownHostException |
creates a new SockIO object wrapping a socket connection to host:port, and its input and output streams
| pool | Pool this object is tied to | |
| host | host to connect to | |
| port | port to connect to | |
| timeout | int ms to block on data for read | |
| connectTimeout | timeout (in ms) for initial connection | |
| noDelay | TCP NODELAY option? |
| IOException | if an io error occurrs when creating socket | |
| UnknownHostException | if hostname is invalid |
| SockIO | ( | SockIOPool | pool, | |
| String | host, | |||
| int | timeout, | |||
| int | connectTimeout, | |||
| boolean | noDelay | |||
| ) | throws IOException, UnknownHostException |
creates a new SockIO object wrapping a socket connection to host:port, and its input and output streams
| host | hostname:port | |
| timeout | read timeout value for connected socket | |
| connectTimeout | timeout for initial connections | |
| noDelay | TCP NODELAY option? |
| IOException | if an io error occurrs when creating socket | |
| UnknownHostException | if hostname is invalid |
| void clearEOL | ( | ) | throws IOException |
reads up to end of line and returns nothing
| IOException | if io problems during read |
Implements LineInputStream.
| void close | ( | ) | [package] |
sets closed flag and checks in to connection pool but does not close connections
| void finalize | ( | ) | throws Throwable [protected] |
Hack to reap any leaking children.
| void flush | ( | ) | throws IOException [package] |
flushes output stream
| IOException | if io problems during read |
| SocketChannel getChannel | ( | ) |
Lets caller get access to underlying channel.
| String getHost | ( | ) |
returns the host this socket is connected to
| static Socket getSocket | ( | String | host, | |
| int | port, | |||
| int | timeout | |||
| ) | throws IOException [static, protected] |
Method which gets a connection from SocketChannel.
| host | host to establish connection to | |
| port | port on that host | |
| timeout | connection timeout in ms |
| IOException | if errors connecting or if connection times out |
| int hashCode | ( | ) |
use the sockets hashcode for this object so we can key off of SockIOs
| boolean isAlive | ( | ) | [package] |
| boolean isConnected | ( | ) | [package] |
checks if the connection is open
| int read | ( | byte[] | b | ) | throws IOException |
reads length bytes into the passed in byte array from dtream
| b | byte array |
| IOException | if io problems during read |
Implements LineInputStream.
| String readLine | ( | ) | throws IOException |
reads a line intentionally not using the deprecated readLine method from DataInputStream
| IOException | if io problems during read |
Implements LineInputStream.
| String toString | ( | ) |
returns the string representation of this socket
| void trueClose | ( | boolean | addToDeadPool | ) | throws IOException |
closes socket and all streams connected to it
| IOException | if fails to close streams or socket |
| void trueClose | ( | ) | throws IOException |
closes socket and all streams connected to it
| IOException | if fails to close streams or socket |
| void write | ( | byte[] | b | ) | throws IOException [package] |
writes a byte array to the output stream
| b | byte array to write |
| IOException | if an io error happens |
DataInputStream in [private] |
BufferedOutputStream out [private] |
SockIOPool pool [private] |
Socket sock [private] |
1.5.8