org.jwall.web.http.nio
Class HttpResponseChannel
java.lang.Object
org.jwall.web.http.nio.HttpMessageChannel<HttpResponse>
org.jwall.web.http.nio.HttpResponseChannel
public class HttpResponseChannel
- extends HttpMessageChannel<HttpResponse>
This class reads from an incoming stream and buffers it, parsing the
stream to read the responses.
Optional it can be requested to merge chunked http-data.
(not implemented yet)
- Author:
- chris@jwall.org
STATE_READING_CHUNKS
public static final int STATE_READING_CHUNKS
- See Also:
- Constant Field Values
STATE_CLOSE_CONNECTION
public static final int STATE_CLOSE_CONNECTION
- See Also:
- Constant Field Values
READING_CHUNK_HEADER
public static final int READING_CHUNK_HEADER
- See Also:
- Constant Field Values
READING_CHUNK_BODY
public static final int READING_CHUNK_BODY
- See Also:
- Constant Field Values
READING_CHUNK_TRAILER
public static final int READING_CHUNK_TRAILER
- See Also:
- Constant Field Values
READING_CRLF
public static final int READING_CRLF
- See Also:
- Constant Field Values
HttpResponseChannel
public HttpResponseChannel(ReadableByteChannel in)
- Create a stream of http-response-packets by reading from the
given input-stream.
- Parameters:
in -
readMessage
public HttpResponse readMessage()
throws IOException,
TimeOutException,
ProtocolException
- Specified by:
readMessage in class HttpMessageChannel<HttpResponse>
- Throws:
IOException
TimeOutException
ProtocolException
readChunk
public HttpChunk readChunk()
throws IOException,
ProtocolException
- Throws:
IOException
ProtocolException
toString
public String toString()
- Overrides:
toString in class Object
status
public String status()
chunkState
public String chunkState()
isConnectionClosed
public boolean isConnectionClosed()
- Returns true if the server has send an "Connection: close"
within the last response.
- Returns:
getNumberOfResponses
public int getNumberOfResponses()
getId
public int getId()
Copyright © 2012 jwall.org. All Rights Reserved.