public interface ClientConnection extends Channel
In general these objects are not thread safe, they should only be used by the IO thread that is responsible for the connection. As a result this client does not provide a mechanism to perform blocking IO, it is designed for async operation only.
Modifier and Type | Method and Description |
---|---|
void | addCloseListener(org.xnio.ChannelListener<ClientConnection> listener) Adds a close listener, than will be invoked with the connection is closed |
ByteBufferPool | getBufferPool() |
org.xnio.ChannelListener.Setter<? extends ClientConnection> | getCloseSetter() |
org.xnio.XnioIoThread | getIoThread() |
SocketAddress | getLocalAddress() |
<A extends SocketAddress> | getLocalAddress(Class<A> type) |
<T> T | getOption(org.xnio.Option<T> option) |
SocketAddress | getPeerAddress() |
<A extends SocketAddress> | getPeerAddress(Class<A> type) |
ClientStatistics | getStatistics() |
org.xnio.XnioWorker | getWorker() |
boolean | isMultiplexingSupported() |
boolean | isOpen() |
boolean | isPushSupported() |
boolean | isUpgraded() |
boolean | isUpgradeSupported() |
org.xnio.StreamConnection | performUpgrade() Upgrade the connection, if the underlying protocol supports it. |
void | sendRequest(ClientRequest request, ClientCallback<ClientExchange> clientCallback) Sends a client request. |
<T> T | setOption(org.xnio.Option<T> option, T value) |
boolean | supportsOption(org.xnio.Option<?> option) |
void sendRequest(ClientRequest request, ClientCallback<ClientExchange> clientCallback)
Request objects can be queued. Once the request is in a state that it is ready to be sent the clientCallback
is invoked to provide the caller with the ClientExchange
If isMultiplexingSupported()
returns true then multiple requests may be active at the same time, and a later request may complete before an earlier one.
Note that the request header may not be written out until after the callback has been invoked. This allows the client to write out a header with a gathering write if the request contains content.
request
- The request to send.org.xnio.StreamConnection performUpgrade() throws IOException
IOException
ByteBufferPool getBufferPool()
SocketAddress getPeerAddress()
<A extends SocketAddress> A getPeerAddress(Class<A> type)
org.xnio.ChannelListener.Setter<? extends ClientConnection> getCloseSetter()
SocketAddress getLocalAddress()
<A extends SocketAddress> A getLocalAddress(Class<A> type)
org.xnio.XnioWorker getWorker()
org.xnio.XnioIoThread getIoThread()
boolean supportsOption(org.xnio.Option<?> option)
<T> T getOption(org.xnio.Option<T> option) throws IOException
IOException
<T> T setOption(org.xnio.Option<T> option, T value) throws IllegalArgumentException, IOException
IllegalArgumentException
IOException
boolean isUpgraded()
boolean isPushSupported()
true
if this connection support server pushboolean isMultiplexingSupported()
true
if this client supports multiplexingClientStatistics getStatistics()
null
if statistics are not supported or disabledboolean isUpgradeSupported()
void addCloseListener(org.xnio.ChannelListener<ClientConnection> listener)
listener
- The close listenerCopyright © 2017 JBoss by Red Hat. All rights reserved.