public class ServerHttp1IOEventHandler extends Object
IOEventHandler
that implements
server side HTTP/1.1 messaging protocol with full support for
duplexed message transmission and message pipelining.Constructor and Description |
---|
ServerHttp1IOEventHandler(ServerHttp1StreamDuplexer streamDuplexer) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes this connection gracefully.
|
void |
close(CloseMode closeMode)
Closes this process or endpoint and releases any system resources associated
with it.
|
void |
connected(IOSession session)
Triggered after the given session has been just created.
|
void |
disconnected(IOSession session)
Triggered when the given session has been terminated.
|
void |
exception(IOSession session,
Exception cause)
Triggered when the given session throws a exception.
|
EndpointDetails |
getEndpointDetails()
Returns this connection's endpoint details.
|
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. |
void |
inputReady(IOSession session,
ByteBuffer src)
Triggered when the given session has input pending.
|
boolean |
isOpen()
Checks if this connection is open.
|
void |
outputReady(IOSession session)
Triggered when the given session is ready for output.
|
void |
setSocketTimeout(Timeout timeout)
Sets the socket timeout value.
|
void |
timeout(IOSession session,
Timeout timeout)
Triggered when the given session has timed out.
|
String |
toString() |
public ServerHttp1IOEventHandler(ServerHttp1StreamDuplexer streamDuplexer)
public void connected(IOSession session) throws IOException
IOEventHandler
connected
in interface IOEventHandler
session
- the I/O session.IOException
public void inputReady(IOSession session, ByteBuffer src) throws IOException
IOEventHandler
inputReady
in interface IOEventHandler
session
- the I/O session.IOException
public void outputReady(IOSession session) throws IOException
IOEventHandler
outputReady
in interface IOEventHandler
session
- the I/O session.IOException
public void timeout(IOSession session, Timeout timeout) throws IOException
IOEventHandler
timeout
in interface IOEventHandler
session
- the I/O session.timeout
- the timeout.IOException
public void exception(IOSession session, Exception cause)
IOEventHandler
exception
in interface IOEventHandler
session
- the I/O session.public void disconnected(IOSession session)
IOEventHandler
disconnected
in interface IOEventHandler
session
- the I/O session.public void close() throws IOException
HttpConnection
shutdown
instead.close
in interface Closeable
close
in interface AutoCloseable
close
in interface HttpConnection
IOException
public void close(CloseMode closeMode)
ModalCloseable
close
in interface ModalCloseable
closeMode
- How to close the receiver.public boolean isOpen()
HttpConnection
isOpen
in interface HttpConnection
public void setSocketTimeout(Timeout timeout)
SocketModalCloseable
setSocketTimeout
in interface SocketModalCloseable
timeout
- timeout valuepublic SSLSession getSSLSession()
HttpConnection
null
if TLS has not been activated.getSSLSession
in interface HttpConnection
null
if TLS has not been activated.public EndpointDetails getEndpointDetails()
HttpConnection
getEndpointDetails
in interface HttpConnection
public Timeout getSocketTimeout()
SocketModalCloseable
getSocketTimeout
in interface SocketModalCloseable
public ProtocolVersion getProtocolVersion()
HttpConnection
null
if unknown.getProtocolVersion
in interface HttpConnection
null
if unknown.public SocketAddress getRemoteAddress()
HttpConnection
null
if it is not connected yet or
unconnected.getRemoteAddress
in interface HttpConnection
null
if it is not connected yet or
unconnected.public SocketAddress getLocalAddress()
HttpConnection
null
if it is not bound yet.getLocalAddress
in interface HttpConnection
null
if it is not bound yet.Copyright © 2005–2021 The Apache Software Foundation. All rights reserved.