public static class SchoonerSockIOPool.UDPSockIO extends SchoonerSockIO
| Modifier and Type | Field and Description |
|---|---|
DatagramChannel |
channel |
static ConcurrentMap<Short,com.schooner.MemCached.SchoonerSockIOPool.UDPSockIO.UDPDataItem> |
dataStore |
static Short |
REQUESTID
UDP datagram frame header:
|
static short |
RESERVED |
static short |
SEQENCE |
static short |
TOTAL |
readBuf, sockets, writeBuf| Constructor and Description |
|---|
SchoonerSockIOPool.UDPSockIO(org.apache.commons.pool.impl.GenericObjectPool sockets,
String host,
int bufferSize,
int timeout) |
| Modifier and Type | Method and Description |
|---|---|
void |
clearEOL()
reads up to end of line and returns nothing
|
void |
close()
sets closed flag and checks in to connection pool but does not close
connections
|
ByteChannel |
getByteChannel()
get byte channel from this socket.
|
SocketChannel |
getChannel()
Lets caller get access to underlying channel.
|
String |
getHost()
returns the host this socket is connected to
|
byte[] |
getResponse(short rid) |
short |
preWrite() |
int |
read(byte[] b)
reads length bytes into the passed in byte array from dtream
|
String |
readLine()
reads a line intentionally not using the deprecated readLine method
from DataInputStream
|
void |
trueClose()
closes socket and all streams connected to it
|
void |
trueClose(boolean addToDeadPool)
closes socket and all streams connected to it
|
getBufferSize, isAlive, setBufferSizefinalize, flush, getSocket, hashCode, isConnected, toString, writepublic static Short REQUESTID
UDP datagram frame header:
+------------+------------+------------+------------+
| Request ID | Sequence | Total | Reserved |
+------------+------------+------------+------------+
| 2bytes | 2bytes | 2bytes | 2bytes |
+------------+------------+------------+------------+
public static final short SEQENCE
public static final short TOTAL
public static final short RESERVED
public static ConcurrentMap<Short,com.schooner.MemCached.SchoonerSockIOPool.UDPSockIO.UDPDataItem> dataStore
public DatagramChannel channel
public SchoonerSockIOPool.UDPSockIO(org.apache.commons.pool.impl.GenericObjectPool sockets,
String host,
int bufferSize,
int timeout)
throws IOException,
UnknownHostException
IOExceptionUnknownHostExceptionpublic void trueClose()
throws IOException
SockIOPool.SockIOtrueClose in class SockIOPool.SockIOIOException - if fails to close streams or socketpublic ByteChannel getByteChannel()
SchoonerSockIOgetByteChannel in class SchoonerSockIOpublic short preWrite()
preWrite in class SchoonerSockIOpublic byte[] getResponse(short rid)
throws IOException
getResponse in class SchoonerSockIOIOExceptionpublic void close()
SockIOPool.SockIOclose in class SockIOPool.SockIOpublic String getHost()
SockIOPool.SockIOgetHost in class SockIOPool.SockIOpublic void clearEOL()
throws IOException
SockIOPool.SockIOclearEOL in interface LineInputStreamclearEOL in class SockIOPool.SockIOIOException - if io problems during readpublic int read(byte[] b)
SockIOPool.SockIOread in interface LineInputStreamread in class SockIOPool.SockIOb - byte arraypublic String readLine() throws IOException
SockIOPool.SockIOreadLine in interface LineInputStreamreadLine in class SockIOPool.SockIOIOException - if io problems during readpublic void trueClose(boolean addToDeadPool)
throws IOException
SockIOPool.SockIOtrueClose in class SockIOPool.SockIOIOException - if fails to close streams or socketpublic SocketChannel getChannel()
SockIOPool.SockIOgetChannel in class SockIOPool.SockIOCopyright © 2013 Schooner Information Technology. All Rights Reserved.