private static class Socks4Proxy.Socks4ProxyConnection extends AbstractConnection implements Callback
Modifier and Type | Class and Description |
---|---|
private class |
Socks4Proxy.Socks4ProxyConnection.Socks4Parser |
Callback.Completable, Callback.Completing, Callback.Nested
Invocable.InvocationType
Connection.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, tryFillInterested
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getInvocationType, getInvocationType, invokeNonBlocking, isNonBlockingInvocation
private 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()
Connection
Callback method invoked when this connection is opened.
Creators of the connection implementation are responsible for calling this method.
onOpen
in interface Connection
onOpen
in class AbstractConnection
private void writeSocks4Connect()
public void succeeded()
Callback
Callback invoked when the operation completes.
succeeded
in interface Callback
Callback.failed(Throwable)
public void failed(java.lang.Throwable x)
Callback
Callback invoked when the operation fails.
public void onFillable()
AbstractConnection
Callback method invoked when the endpoint is ready to be read.
onFillable
in class AbstractConnection
AbstractConnection.fillInterested()
private void onSocks4Response(int responseCode) throws java.io.IOException
java.io.IOException
private void tunnel()