public interface Transport extends Socket
Transport
interface represents a low level means
to deliver content to the connected client. Typically this will
be a connected, non-blocking, TCP connection. However, for tests
and other purposes this may be adapted. The general contract of
the transport is that it provides non-blocking reads and blocking
writes. Blocking writes are required to ensure that memory does
not build up in output buffers during high load periods.Modifier and Type | Method and Description |
---|---|
void |
close()
This is used to close the transport and the underlying socket.
|
void |
flush()
This method is used to flush the contents of the buffer to
the client.
|
int |
read(java.nio.ByteBuffer buffer)
This is used to perform a non-blocking read on the transport.
|
void |
write(java.nio.ByteBuffer buffer)
This method is used to deliver the provided buffer of bytes to
the underlying transport.
|
getAttributes, getChannel, getEngine
int read(java.nio.ByteBuffer buffer) throws java.io.IOException
buffer
- this is the buffer to append the bytes tojava.io.IOException
void write(java.nio.ByteBuffer buffer) throws java.io.IOException
buffer
- this is the buffer of bytes to send to the clientjava.io.IOException
void flush() throws java.io.IOException
java.io.IOException
void close() throws java.io.IOException
java.io.IOException