class HttpTunnelingClientSocketChannel extends AbstractChannel implements SocketChannel
| Modifier and Type | Class and Description |
|---|---|
(package private) class |
HttpTunnelingClientSocketChannel.ServletChannelHandler |
| Modifier and Type | Field and Description |
|---|---|
(package private) HttpTunnelingSocketChannelConfig |
config |
private HttpTunnelingClientSocketChannel.ServletChannelHandler |
handler |
(package private) java.lang.Object |
interestOpsLock |
(package private) SocketChannel |
realChannel |
(package private) boolean |
requestHeaderWritten |
OP_NONE, OP_READ, OP_READ_WRITE, OP_WRITE| Constructor and Description |
|---|
HttpTunnelingClientSocketChannel(ChannelFactory factory,
ChannelPipeline pipeline,
ChannelSink sink,
ClientSocketChannelFactory clientSocketChannelFactory) |
| Modifier and Type | Method and Description |
|---|---|
(package private) void |
bindReal(java.net.SocketAddress localAddress,
ChannelFuture future) |
(package private) void |
closeReal(ChannelFuture future) |
(package private) void |
connectReal(java.net.SocketAddress remoteAddress,
ChannelFuture future) |
(package private) void |
disconnectReal(ChannelFuture future) |
HttpTunnelingSocketChannelConfig |
getConfig()
Returns the configuration of this channel.
|
int |
getInterestOps()
Returns the current
interestOps of this channel. |
java.net.InetSocketAddress |
getLocalAddress()
Returns the local address where this channel is bound to.
|
java.net.InetSocketAddress |
getRemoteAddress()
Returns the remote address where this channel is connected to.
|
boolean |
isBound()
Returns
true if and only if this channel is bound to a
local address. |
boolean |
isConnected()
Returns
true if and only if this channel is connected to a
remote address. |
boolean |
isWritable()
Returns
true if and only if the I/O thread will perform the
requested write operation immediately. |
protected boolean |
setClosed()
Marks this channel as closed.
|
(package private) void |
setInterestOpsReal(int interestOps,
ChannelFuture future) |
(package private) void |
unbindReal(ChannelFuture future) |
ChannelFuture |
write(java.lang.Object message,
java.net.SocketAddress remoteAddress)
Sends a message to this channel asynchronously.
|
private ChannelFuture |
writeLastChunk() |
(package private) void |
writeReal(ChannelBuffer a,
ChannelFuture future) |
bind, close, compareTo, connect, disconnect, equals, getAttachment, getCloseFuture, getFactory, getId, getInternalInterestOps, getParent, getPipeline, getSucceededFuture, getUnsupportedOperationFuture, getUserDefinedWritability, hashCode, isOpen, isReadable, setAttachment, setInterestOps, setInternalInterestOps, setReadable, setUnwritable, setUserDefinedWritability, setWritable, toString, unbind, writeclone, finalize, getClass, notify, notifyAll, wait, wait, waitbind, close, connect, disconnect, getAttachment, getCloseFuture, getFactory, getId, getParent, getPipeline, getUserDefinedWritability, isOpen, isReadable, setAttachment, setInterestOps, setReadable, setUserDefinedWritability, unbind, writefinal HttpTunnelingSocketChannelConfig config
volatile boolean requestHeaderWritten
final java.lang.Object interestOpsLock
final SocketChannel realChannel
private final HttpTunnelingClientSocketChannel.ServletChannelHandler handler
HttpTunnelingClientSocketChannel(ChannelFactory factory, ChannelPipeline pipeline, ChannelSink sink, ClientSocketChannelFactory clientSocketChannelFactory)
public HttpTunnelingSocketChannelConfig getConfig()
ChannelgetConfig in interface ChannelgetConfig in interface SocketChannelpublic java.net.InetSocketAddress getLocalAddress()
ChannelSocketAddress is supposed to be down-cast into more concrete
type such as InetSocketAddress to retrieve the detailed
information.getLocalAddress in interface ChannelgetLocalAddress in interface SocketChannelnull if this channel is not bound.public java.net.InetSocketAddress getRemoteAddress()
ChannelSocketAddress is supposed to be down-cast into more
concrete type such as InetSocketAddress to retrieve the detailed
information.getRemoteAddress in interface ChannelgetRemoteAddress in interface SocketChannelnull if this channel is not connected.
If this channel is not connected but it can receive messages
from arbitrary remote addresses (e.g. DatagramChannel,
use MessageEvent.getRemoteAddress() to determine
the origination of the received message as this method will
return null.public boolean isBound()
Channeltrue if and only if this channel is bound to a
local address.public boolean isConnected()
Channeltrue if and only if this channel is connected to a
remote address.isConnected in interface Channelpublic int getInterestOps()
ChannelinterestOps of this channel.getInterestOps in interface ChannelgetInterestOps in class AbstractChannelChannel.OP_NONE, Channel.OP_READ, Channel.OP_WRITE, or
Channel.OP_READ_WRITEpublic boolean isWritable()
Channeltrue if and only if the I/O thread will perform the
requested write operation immediately. Any write requests made when
this method returns false are queued until the I/O thread is
ready to process the queued write requests. This method is a shortcut
to the following code:
return (getInterestOps() & OP_WRITE) == 0;
isWritable in interface ChannelisWritable in class AbstractChannelprotected boolean setClosed()
AbstractChannelsetClosed in class AbstractChanneltrue if and only if this channel was not marked as
closed yetpublic ChannelFuture write(java.lang.Object message, java.net.SocketAddress remoteAddress)
ChannelDatagramChannel)
and is not connected yet, you must specify non-null address. Otherwise,
the write request will fail with NotYetConnectedException and
an 'exceptionCaught' event will be triggered.write in interface Channelwrite in class AbstractChannelmessage - the message to writeremoteAddress - where to send the specified message.
This method is identical to Channel.write(Object)
if null is specified here.ChannelFuture which will be notified when the
write request succeeds or failsvoid bindReal(java.net.SocketAddress localAddress,
ChannelFuture future)
void connectReal(java.net.SocketAddress remoteAddress,
ChannelFuture future)
void writeReal(ChannelBuffer a, ChannelFuture future)
private ChannelFuture writeLastChunk()
void setInterestOpsReal(int interestOps,
ChannelFuture future)
void disconnectReal(ChannelFuture future)
void unbindReal(ChannelFuture future)
void closeReal(ChannelFuture future)