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.
|
Certificate |
getCertificate()
This is used to acquire the SSL certificate used when the
server is using a HTTPS connection.
|
int |
read(ByteBuffer buffer)
This is used to perform a non-blocking read on the transport.
|
void |
write(ByteBuffer buffer)
This method is used to deliver the provided buffer of bytes to
the underlying transport.
|
getAttributes, getChannel, getEngine, getTrace
Certificate getCertificate() throws IOException
IOException
int read(ByteBuffer buffer) throws IOException
buffer
- this is the buffer to append the bytes toIOException
void write(ByteBuffer buffer) throws IOException
buffer
- this is the buffer of bytes to send to the clientIOException
void flush() throws IOException
IOException
void close() throws IOException
IOException
Copyright © 2022. All rights reserved.