com.alisoft.xplatform.asf.cache.memcached.client
类 SockIOPool.SockIO

java.lang.Object
  继承者 com.alisoft.xplatform.asf.cache.memcached.client.SockIOPool.SockIO
包容类:
SockIOPool

public static class SockIOPool.SockIO
extends java.lang.Object

MemCached Java client, utility class for Socket IO. This class is a wrapper around a Socket and its streams.

版本:
1.5
作者:
greg whalin , Richard 'toast' Russo

构造方法摘要
SockIOPool.SockIO(SockIOPool pool, java.lang.String host, int timeout, int connectTimeout, boolean noDelay)
          creates a new SockIO object wrapping a socket connection to host:port, and its input and output streams
SockIOPool.SockIO(SockIOPool pool, java.lang.String host, int port, int timeout, int connectTimeout, boolean noDelay)
          creates a new SockIO object wrapping a socket connection to host:port, and its input and output streams
 
方法摘要
protected  void finalize()
          Hack to reap any leaking children.
 java.nio.channels.SocketChannel getChannel()
          Lets caller get access to underlying channel.
 java.lang.String getHost()
          returns the host this socket is connected to
protected static java.net.Socket getSocket(java.lang.String host, int port, int timeout)
          Method which gets a connection from SocketChannel.
 int hashCode()
          use the sockets hashcode for this object so we can key off of SockIOs
 byte[] readBytes(int length)
           
 java.lang.String readLine()
          reads a line intentionally not using the deprecated readLine method from DataInputStream
 java.lang.String toString()
          returns the string representation of this socket
 void trueClose()
          closes socket and all streams connected to it
 void trueClose(boolean addToDeadPool)
          closes socket and all streams connected to it
 
从类 java.lang.Object 继承的方法
clone, equals, getClass, notify, notifyAll, wait, wait, wait
 

构造方法详细信息

SockIOPool.SockIO

public SockIOPool.SockIO(SockIOPool pool,
                         java.lang.String host,
                         int port,
                         int timeout,
                         int connectTimeout,
                         boolean noDelay)
                  throws java.io.IOException,
                         java.net.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?
抛出:
java.io.IOException - if an io error occurrs when creating socket
java.net.UnknownHostException - if hostname is invalid

SockIOPool.SockIO

public SockIOPool.SockIO(SockIOPool pool,
                         java.lang.String host,
                         int timeout,
                         int connectTimeout,
                         boolean noDelay)
                  throws java.io.IOException,
                         java.net.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?
抛出:
java.io.IOException - if an io error occurrs when creating socket
java.net.UnknownHostException - if hostname is invalid
方法详细信息

getSocket

protected static java.net.Socket getSocket(java.lang.String host,
                                           int port,
                                           int timeout)
                                    throws java.io.IOException
Method which gets a connection from SocketChannel.

参数:
host - host to establish connection to
port - port on that host
timeout - connection timeout in ms
返回:
connected socket
抛出:
java.io.IOException - if errors connecting or if connection times out

getChannel

public java.nio.channels.SocketChannel getChannel()
Lets caller get access to underlying channel.

返回:
the backing SocketChannel

getHost

public java.lang.String getHost()
returns the host this socket is connected to

返回:
String representation of host (hostname:port)

trueClose

public void trueClose()
               throws java.io.IOException
closes socket and all streams connected to it

抛出:
java.io.IOException - if fails to close streams or socket

trueClose

public void trueClose(boolean addToDeadPool)
               throws java.io.IOException
closes socket and all streams connected to it

抛出:
java.io.IOException - if fails to close streams or socket

readBytes

public byte[] readBytes(int length)
                 throws java.io.IOException
抛出:
java.io.IOException

readLine

public java.lang.String readLine()
                          throws java.io.IOException
reads a line intentionally not using the deprecated readLine method from DataInputStream

返回:
String that was read in
抛出:
java.io.IOException - if io problems during read

hashCode

public int hashCode()
use the sockets hashcode for this object so we can key off of SockIOs

覆盖:
java.lang.Object 中的 hashCode
返回:
int hashcode

toString

public java.lang.String toString()
returns the string representation of this socket

覆盖:
java.lang.Object 中的 toString
返回:
string

finalize

protected void finalize()
                 throws java.lang.Throwable
Hack to reap any leaking children.

覆盖:
java.lang.Object 中的 finalize
抛出:
java.lang.Throwable


Copyright © 2009 . All Rights Reserved.