Package one.nio.http
Class HttpSession
java.lang.Object
one.nio.net.Session
one.nio.http.HttpSession
- All Implemented Interfaces:
Closeable,AutoCloseable
-
Nested Class Summary
Nested classes/interfaces inherited from class one.nio.net.Session
Session.ArrayQueueItem, Session.QueueItem -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Requestprotected final byte[]protected intprotected Requestprotected Requestprotected final LinkedList<Request> protected intprotected final HttpServerFields inherited from class one.nio.net.Session
ACTIVE, closing, CLOSING, EVENT_MASK, events, eventsToListen, IDLE, lastAccessTime, log, queueHead, READABLE, selector, slot, socket, SSL, STALE, wasSelected, WRITEABLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintcheckStatus(long currentTime, long keepAlive) protected intprotected voidprotected voidprotected RequestparseRequest(byte[] buffer, int start, int length) protected intprocessHttpBuffer(byte[] buffer, int length) protected voidprocessRead(byte[] buffer) voidvoidsendResponse(Response response) protected intstartParsingRequestBody(String contentLengthHeader, byte[] buffer, int offset, int remaining) protected voidwriteResponse(Response response, boolean includeBody) Methods inherited from class one.nio.net.Session
close, getQueueStats, getRemoteHost, handleException, isSsl, lastAccessTime, listen, process, processWrite, read, readRaw, scheduleClose, socket, write, write, write
-
Field Details
-
FIN
-
server
-
pipeline
-
fragment
protected final byte[] fragment -
fragmentLength
protected int fragmentLength -
requestBodyOffset
protected int requestBodyOffset -
parsing
-
handling
-
-
Constructor Details
-
HttpSession
-
-
Method Details
-
checkStatus
public int checkStatus(long currentTime, long keepAlive) - Overrides:
checkStatusin classSession
-
processRead
- Overrides:
processReadin classSession- Throws:
IOException
-
handleSocketClosed
protected void handleSocketClosed() -
getMaxRequestBodyLength
protected int getMaxRequestBodyLength() -
startParsingRequestBody
protected int startParsingRequestBody(String contentLengthHeader, byte[] buffer, int offset, int remaining) throws IOException, HttpException - Throws:
IOExceptionHttpException
-
handleParsedRequest
- Throws:
IOException
-
processHttpBuffer
- Throws:
IOExceptionHttpException
-
parseRequest
- Throws:
HttpException
-
sendResponse
- Throws:
IOException
-
sendError
- Throws:
IOException
-
writeResponse
- Throws:
IOException
-