protected static class HttpTunnelServer.HttpConnection extends Object
| Constructor and Description |
|---|
HttpConnection(ServerHttpRequest request,
ServerHttpResponse response) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
complete()
Called when a request is complete.
|
ServerHttpRequest |
getRequest()
Return the underlying request.
|
protected ServerHttpResponse |
getResponse()
Return the underlying response.
|
boolean |
isDisconnectRequest()
Detect if the request is actually a signal to disconnect.
|
boolean |
isOlderThan(int time)
Determine if a connection is older than the specified time.
|
void |
respond(HttpStatus status)
Send an HTTP status response.
|
void |
respond(HttpTunnelPayload payload)
Send a payload response.
|
protected ServerHttpAsyncRequestControl |
startAsync()
Start asynchronous support or if unavailable return
null to cause
waitForResponse() to block. |
void |
waitForResponse()
Cause the request to block or use asynchronous methods to wait until a response
is available.
|
public HttpConnection(ServerHttpRequest request, ServerHttpResponse response)
protected ServerHttpAsyncRequestControl startAsync()
null to cause
waitForResponse() to block.public final ServerHttpRequest getRequest()
protected final ServerHttpResponse getResponse()
public boolean isOlderThan(int time)
time - the time to checktrue if the request is older than the timepublic void waitForResponse()
public boolean isDisconnectRequest()
public void respond(HttpStatus status) throws IOException
status - the status to sendIOException - in case of I/O errorspublic void respond(HttpTunnelPayload payload) throws IOException
payload - the payload to sendIOException - in case of I/O errorsprotected void complete()