public interface Responder
Modifier and Type | Method and Description |
---|---|
void |
closeConnectionImmediately()
Closes the connection
|
ByteBuffer |
getData()
Returns the just-received request in a byte buffer.
|
byte[] |
getDataAsBytes()
Returns the just-received request as an array of bytes
|
void |
sendReply(byte[] bytes)
Sends a response as an array of bytes.
|
void |
sendReply(ByteBuffer byteBuffer)
Sends a response from a byte buffer.
|
void |
sendReplyAndClose(byte[] bytes)
Sends a response as an array of bytes and then closes the connection.
|
void |
sendReplyAndClose(ByteBuffer byteBuffer)
Sends a response from a byte buffer and then closes the connection.
|
byte[] getDataAsBytes() throws IOException
IOException
ByteBuffer getData() throws IOException
IOException
void sendReplyAndClose(byte[] bytes) throws IOException
bytes
- the contents of the responseIOException
void sendReply(byte[] bytes) throws IOException
bytes
- the contents of the responseIOException
void sendReplyAndClose(ByteBuffer byteBuffer) throws IOException
byteBuffer
- the outgoing responseIOException
void sendReply(ByteBuffer byteBuffer) throws IOException
byteBuffer
- the outgoing responseIOException
void closeConnectionImmediately() throws IOException
IOException
Copyright © 2014. All rights reserved.