private static class Socks4Proxy.Socks4ProxyConnection extends AbstractConnection implements Callback
| Modifier and Type | Class and Description |
|---|---|
private class |
Socks4Proxy.Socks4ProxyConnection.Socks4Parser |
Callback.Completable, Callback.NestedInvocable.InvocationTypeConnection.Listener, Connection.UpgradeFrom, Connection.UpgradeTo| Modifier and Type | Field and Description |
|---|---|
private ClientConnectionFactory |
connectionFactory |
private java.util.Map<java.lang.String,java.lang.Object> |
context |
private static java.util.regex.Pattern |
IPv4_PATTERN |
private static Logger |
LOG |
private Socks4Proxy.Socks4ProxyConnection.Socks4Parser |
parser |
__nonBlocking| Constructor and Description |
|---|
Socks4ProxyConnection(EndPoint endPoint,
java.util.concurrent.Executor executor,
ClientConnectionFactory connectionFactory,
java.util.Map<java.lang.String,java.lang.Object> context) |
| Modifier and Type | Method and Description |
|---|---|
void |
failed(java.lang.Throwable x)
Callback invoked when the operation fails.
|
void |
onFillable()
Callback method invoked when the endpoint is ready to be read.
|
void |
onOpen()
Callback method invoked when this connection is opened.
|
private void |
onSocks4Response(int responseCode) |
void |
succeeded()
Callback invoked when the operation completes.
|
private void |
tunnel() |
private void |
writeSocks4Connect()
Writes the SOCKS "connect" bytes, differentiating between SOCKS 4 and 4A;
the former sends an IPv4 address, the latter the full domain name.
|
addListener, close, failedCallback, fillInterested, getBytesIn, getBytesOut, getCreatedTimeStamp, getEndPoint, getExecutor, getInputBufferSize, getMessagesIn, getMessagesOut, isFillInterested, onClose, onFillInterestedFailed, onIdleExpired, onReadTimeout, removeListener, setInputBufferSize, toConnectionString, toString, tryFillInterested, tryFillInterestedclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetInvocationType, getInvocationType, invokeNonBlocking, isNonBlockingInvocationprivate static final java.util.regex.Pattern IPv4_PATTERN
private static final Logger LOG
private final Socks4Proxy.Socks4ProxyConnection.Socks4Parser parser
private final ClientConnectionFactory connectionFactory
private final java.util.Map<java.lang.String,java.lang.Object> context
public Socks4ProxyConnection(EndPoint endPoint, java.util.concurrent.Executor executor, ClientConnectionFactory connectionFactory, java.util.Map<java.lang.String,java.lang.Object> context)
public void onOpen()
ConnectionCallback method invoked when this connection is opened.
Creators of the connection implementation are responsible for calling this method.
onOpen in interface ConnectiononOpen in class AbstractConnectionprivate void writeSocks4Connect()
public void succeeded()
CallbackCallback invoked when the operation completes.
succeeded in interface CallbackCallback.failed(Throwable)public void failed(java.lang.Throwable x)
CallbackCallback invoked when the operation fails.
public void onFillable()
AbstractConnectionCallback method invoked when the endpoint is ready to be read.
onFillable in class AbstractConnectionAbstractConnection.fillInterested()private void onSocks4Response(int responseCode)
throws java.io.IOException
java.io.IOExceptionprivate void tunnel()