|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.glassfish.grizzly.nio.AbstractNIOConnection
org.glassfish.grizzly.nio.transport.TCPNIOConnection
public class TCPNIOConnection
Connection implementation
for the TCPNIOTransport
| Field Summary |
|---|
| Fields inherited from class org.glassfish.grizzly.nio.AbstractNIOConnection |
|---|
asyncReadQueue, asyncWriteQueue, attributes, channel, isBlocking, isClosed, processor, processorSelector, readBufferSize, selectionKey, selectorRunner, transport, writeBufferSize |
| Constructor Summary | |
|---|---|
TCPNIOConnection(TCPNIOTransport transport,
SelectableChannel channel)
|
|
| Method Summary | |
|---|---|
SocketAddress |
getLocalAddress()
Returns the local address of this Connection, or null if it is unconnected. |
SocketAddress |
getPeerAddress()
Returns the address of the endpoint this Connection is connected to, or null if it is unconnected. |
StreamReader |
getStreamReader()
Get the Connection StreamReader, to read data from the
Connection. |
StreamWriter |
getStreamWriter()
Get the Connection StreamWriter, to write data to the
Connection. |
protected void |
preClose()
|
Future<ReadResult<Buffer,SocketAddress>> |
read(Buffer buffer,
CompletionHandler<ReadResult<Buffer,SocketAddress>> completionHandler,
Condition<ReadResult<Buffer,SocketAddress>> condition)
Method reads data to the buffer. |
protected void |
resetAddresses()
|
protected void |
setSelectionKey(SelectionKey selectionKey)
|
protected void |
setSelectorRunner(SelectorRunner selectorRunner)
|
Future<WriteResult<Buffer,SocketAddress>> |
write(SocketAddress dstAddress,
Buffer buffer,
CompletionHandler<WriteResult<Buffer,SocketAddress>> completionHandler)
Method writes the buffer to the specific address. |
| Methods inherited from class org.glassfish.grizzly.nio.AbstractNIOConnection |
|---|
close, configureBlocking, disableIOEvent, enableIOEvent, getAsyncReadQueue, getAsyncWriteQueue, getAttributes, getChannel, getProcessor, getProcessorSelector, getReadBufferSize, getSelectionKey, getSelectorRunner, getTransport, getWriteBufferSize, isBlocking, isOpen, obtainAttributes, read, read, read, setChannel, setProcessor, setProcessorSelector, setReadBufferSize, setWriteBufferSize, write, write, write |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TCPNIOConnection(TCPNIOTransport transport,
SelectableChannel channel)
| Method Detail |
|---|
protected void setSelectionKey(SelectionKey selectionKey)
setSelectionKey in class AbstractNIOConnectionprotected void setSelectorRunner(SelectorRunner selectorRunner)
setSelectorRunner in class AbstractNIOConnectionpublic StreamReader getStreamReader()
ConnectionConnection StreamReader, to read data from the
Connection.
Connection StreamReader, to read data from the
Connection.public StreamWriter getStreamWriter()
ConnectionConnection StreamWriter, to write data to the
Connection.
Connection StreamWriter, to write data to the
Connection.protected void preClose()
preClose in class AbstractNIOConnectionpublic SocketAddress getPeerAddress()
public SocketAddress getLocalAddress()
protected void resetAddresses()
public Future<ReadResult<Buffer,SocketAddress>> read(Buffer buffer,
CompletionHandler<ReadResult<Buffer,SocketAddress>> completionHandler,
Condition<ReadResult<Buffer,SocketAddress>> condition)
throws IOException
Readable
buffer - the buffer, where data will be readcompletionHandler - CompletionHandler,
which will get notified, when read will be completedcondition - Condition, which will be checked
each time new portion of a data was read to a buffer.
The condition can decide, whether asynchronous read is
completed or not.
Future, using which it's possible to check the result
IOException
public Future<WriteResult<Buffer,SocketAddress>> write(SocketAddress dstAddress,
Buffer buffer,
CompletionHandler<WriteResult<Buffer,SocketAddress>> completionHandler)
throws IOException
Writable
dstAddress - the destination address the buffer will be
sent tobuffer - the buffer, from which the data will be writtencompletionHandler - CompletionHandler,
which will get notified, when write will be completed
Future, using which it's possible to check the
result
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||