public class HttpConnectionHandler extends Object implements ConnectionHandler
ConnectionHandler
.Constructor and Description |
---|
HttpConnectionHandler(HttpCommunicationProtocol communicationProtocol,
HttpConversation conversation,
HttpRequestParser parser,
long connectionTimeout)
Initiate.
|
Modifier and Type | Method and Description |
---|---|
void |
handleHeartbeat(HeartBeatContext context)
Handles a heart beat on
Connection . |
void |
handleRead(ReadContext context)
Handles a read from the
SocketChannel . |
public HttpConnectionHandler(HttpCommunicationProtocol communicationProtocol, HttpConversation conversation, HttpRequestParser parser, long connectionTimeout)
communicationProtocol
- HttpCommunicationProtocol
.conversation
- HttpConversation
.parser
- HttpRequestParser
.connectionTimeout
- Connection
timeout in milliseconds.public void handleRead(ReadContext context) throws IOException
ConnectionHandler
SocketChannel
.handleRead
in interface ConnectionHandler
context
- ReadContext
.IOException
- If fails to obtain data from the ReadContext
.public void handleHeartbeat(HeartBeatContext context)
ConnectionHandler
Handles a heart beat on Connection
.
Typical use of the heart beat is to allow the ConnectionHandler
to close an idle Connection
.
handleHeartbeat
in interface ConnectionHandler
context
- HeartBeatContext
.Copyright © 2005–2016. All rights reserved.