@Internal public class ServerHttp1StreamDuplexer extends Object
ProtocolIOSession that implements
server side HTTP/1.1 messaging protocol with full support for
duplexed message transmission and message pipelining.| 构造器和说明 |
|---|
ServerHttp1StreamDuplexer(ProtocolIOSession ioSession,
HttpProcessor httpProcessor,
HandlerFactory<AsyncServerExchangeHandler> exchangeHandlerFactory,
String scheme,
Http1Config http1Config,
CharCodingConfig charCodingConfig,
ConnectionReuseStrategy connectionReuseStrategy,
NHttpMessageParser<HttpRequest> incomingMessageParser,
NHttpMessageWriter<HttpResponse> outgoingMessageWriter,
ContentLengthStrategy incomingContentStrategy,
ContentLengthStrategy outgoingContentStrategy,
Http1StreamListener streamListener) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
close()
Closes this connection gracefully.
|
void |
close(CloseMode closeMode)
Closes this process or endpoint and releases any system resources associated
with it.
|
protected ContentDecoder |
createContentDecoder(long len,
ReadableByteChannel channel,
SessionInputBuffer buffer,
BasicHttpTransportMetrics metrics) |
protected ContentEncoder |
createContentEncoder(long len,
WritableByteChannel channel,
SessionOutputBuffer buffer,
BasicHttpTransportMetrics metrics) |
EndpointDetails |
getEndpointDetails()
Returns this connection's endpoint details.
|
String |
getId() |
SocketAddress |
getLocalAddress()
Returns this connection's local address or
null if it is not bound yet. |
ProtocolVersion |
getProtocolVersion()
Returns this connection's protocol version or
null if unknown. |
SocketAddress |
getRemoteAddress()
Returns this connection's remote address or
null if it is not connected yet or
unconnected. |
Timeout |
getSocketTimeout()
Returns the socket timeout value.
|
SSLSession |
getSSLSession()
Returns this connection's SSL session or
null if TLS has not been activated. |
protected boolean |
handleIncomingMessage(HttpRequest request) |
protected boolean |
handleOutgoingMessage(HttpResponse response) |
boolean |
isOpen()
Checks if this connection is open.
|
void |
onConnect() |
void |
onDisconnect() |
void |
onException(Exception ex) |
void |
onInput(ByteBuffer src) |
void |
onOutput() |
void |
onTimeout(Timeout timeout) |
void |
setSocketTimeout(Timeout timeout)
Sets the socket timeout value.
|
String |
toString() |
public ServerHttp1StreamDuplexer(ProtocolIOSession ioSession, HttpProcessor httpProcessor, HandlerFactory<AsyncServerExchangeHandler> exchangeHandlerFactory, String scheme, Http1Config http1Config, CharCodingConfig charCodingConfig, ConnectionReuseStrategy connectionReuseStrategy, NHttpMessageParser<HttpRequest> incomingMessageParser, NHttpMessageWriter<HttpResponse> outgoingMessageWriter, ContentLengthStrategy incomingContentStrategy, ContentLengthStrategy outgoingContentStrategy, Http1StreamListener streamListener)
protected boolean handleIncomingMessage(HttpRequest request) throws HttpException
HttpExceptionprotected ContentDecoder createContentDecoder(long len, ReadableByteChannel channel, SessionInputBuffer buffer, BasicHttpTransportMetrics metrics) throws HttpException
HttpExceptionprotected boolean handleOutgoingMessage(HttpResponse response) throws HttpException
HttpExceptionprotected ContentEncoder createContentEncoder(long len, WritableByteChannel channel, SessionOutputBuffer buffer, BasicHttpTransportMetrics metrics) throws HttpException
HttpExceptionpublic String getId()
getId 在接口中 Identifiablepublic final void onConnect()
throws HttpException,
IOException
public final void onInput(ByteBuffer src) throws HttpException, IOException
public final void onOutput()
throws IOException,
HttpException
public final void onTimeout(Timeout timeout) throws IOException, HttpException
public final void onException(Exception ex)
public final void onDisconnect()
public void close()
throws IOException
HttpConnectionshutdown instead.close 在接口中 Closeableclose 在接口中 AutoCloseableclose 在接口中 HttpConnectionIOExceptionpublic void close(CloseMode closeMode)
ModalCloseableclose 在接口中 ModalCloseablecloseMode - How to close the receiver.public boolean isOpen()
HttpConnectionisOpen 在接口中 HttpConnectionpublic Timeout getSocketTimeout()
SocketModalCloseablegetSocketTimeout 在接口中 SocketModalCloseablepublic void setSocketTimeout(Timeout timeout)
SocketModalCloseablesetSocketTimeout 在接口中 SocketModalCloseabletimeout - timeout valuepublic EndpointDetails getEndpointDetails()
HttpConnectiongetEndpointDetails 在接口中 HttpConnectionpublic ProtocolVersion getProtocolVersion()
HttpConnectionnull if unknown.getProtocolVersion 在接口中 HttpConnectionnull if unknown.public SocketAddress getRemoteAddress()
HttpConnectionnull if it is not connected yet or
unconnected.getRemoteAddress 在接口中 HttpConnectionnull if it is not connected yet or
unconnected.public SocketAddress getLocalAddress()
HttpConnectionnull if it is not bound yet.getLocalAddress 在接口中 HttpConnectionnull if it is not bound yet.public SSLSession getSSLSession()
HttpConnectionnull if TLS has not been activated.getSSLSession 在接口中 HttpConnectionnull if TLS has not been activated.Copyright © 2023. All rights reserved.