Package one.nio.rpc
Class RpcSession<S,M>
java.lang.Object
one.nio.net.Session
one.nio.rpc.RpcSession<S,M>
- All Implemented Interfaces:
Closeable,AutoCloseable
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class one.nio.net.Session
Session.ArrayQueueItem, Session.QueueItem -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected byte[]protected static final intprotected intprotected static final byteprotected static final org.slf4j.Loggerprotected InetSocketAddressprotected booleanprotected intprotected longFields 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 TypeMethodDescriptionprivate byte[]expandBuffer(int requestSize) protected voidprotected voidhandleRejectedExecution(RejectedExecutionException e, Object request) protected voidprotected booleanisAsyncRequest(Object request) protected Mprivate voidprotected voidprocessRead(byte[] unusedBuffer) private intprivate static booleanstartsWith(byte[] buffer, int from, String s) protected voidstreamCommunicate(StreamProxy streamProxy) protected intwriteResponse(Object response) Methods inherited from class one.nio.net.Session
checkStatus, close, getQueueStats, getRemoteHost, handleException, isSsl, lastAccessTime, listen, process, processWrite, read, readRaw, scheduleClose, socket, write, write, write
-
Field Details
-
logSerialize
protected static final org.slf4j.Logger logSerialize -
BUFFER_SIZE
protected static final int BUFFER_SIZE- See Also:
-
HTTP_REQUEST_UID
protected static final byte HTTP_REQUEST_UID -
server
-
peer
-
proxyProtocol
protected boolean proxyProtocol -
buffer
protected byte[] buffer -
bytesRead
protected int bytesRead -
requestSize
protected int requestSize -
requestStartTime
protected long requestStartTime
-
-
Constructor Details
-
RpcSession
-
-
Method Details
-
processRead
- Overrides:
processReadin classSession- Throws:
Exception
-
parseProxyProtocol
- Throws:
IOException
-
expandBuffer
private byte[] expandBuffer(int requestSize) -
readHttpHeader
- Throws:
IOException
-
startsWith
-
isAsyncRequest
-
onRequestRead
-
writeResponse
- Throws:
IOException
-
streamCommunicate
- Throws:
IOException
-
invoke
- Throws:
Exception
-
handleDeserializationException
- Throws:
IOException
-
handleRejectedExecution
protected void handleRejectedExecution(RejectedExecutionException e, Object request) throws IOException - Throws:
IOException
-