|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.trendrr.oss.networking.SocketChannelWrapper
public class SocketChannelWrapper
| Constructor Summary | |
|---|---|
SocketChannelWrapper(java.nio.channels.SocketChannel channel)
|
|
| Method Summary | |
|---|---|
void |
close()
attempts to process the remaining callbacks, then closes the channel and cleans up any resources. |
void |
doRead()
Attempts to read from the network, and process any callbacks. |
java.nio.channels.SocketChannel |
getChannel()
|
java.util.Queue<java.nio.ByteBuffer> |
getWrites()
|
boolean |
hasReads()
returns true if any reads are waiting. |
boolean |
hasWrites()
returns true if there are any writes waiting. |
boolean |
isClosed()
|
byte[] |
readBytes(int numBytes)
|
void |
readBytes(int numBytes,
ByteReadCallback callback)
|
java.lang.String |
readUntil(java.lang.String delimiter,
java.nio.charset.Charset charset)
reads until the requested string is found. |
void |
readUntil(java.lang.String delimiter,
java.nio.charset.Charset charset,
StringReadCallback callback)
|
void |
write(byte[] bytes)
|
void |
write(java.nio.ByteBuffer buf)
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SocketChannelWrapper(java.nio.channels.SocketChannel channel)
| Method Detail |
|---|
public void readUntil(java.lang.String delimiter,
java.nio.charset.Charset charset,
StringReadCallback callback)
public java.lang.String readUntil(java.lang.String delimiter,
java.nio.charset.Charset charset)
throws TrendrrException
delimiter - charset -
TrendrrException
public void readBytes(int numBytes,
ByteReadCallback callback)
public byte[] readBytes(int numBytes)
throws TrendrrException
TrendrrExceptionpublic void write(java.nio.ByteBuffer buf)
public void write(byte[] bytes)
public boolean hasWrites()
public boolean hasReads()
public java.nio.channels.SocketChannel getChannel()
public java.util.Queue<java.nio.ByteBuffer> getWrites()
public void doRead()
throws TrendrrNoCallbackException,
TrendrrDisconnectedException,
TrendrrException
TrendrrNoCallbackException
TrendrrDisconnectedException
TrendrrExceptionpublic void close()
public boolean isClosed()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||