{
if (!(remoteAddress instanceof InetSocketAddress)) {
throw new IllegalArgumentException("expecting InetSocketAddress");
}
final SettableChannelFuture settableChannelFuture = new SettableChannelFuture();
super.connect(new InetSocketAddress(socksProxyAddr.getHostText(), socksProxyAddr.getPort())).addListener(new ChannelFutureListener()
{
@Override
public void operationComplete(ChannelFuture future)
throws Exception
{
settableChannelFuture.setChannel(future.getChannel());
if (future.isSuccess()) {
socksConnect(future.getChannel(), (InetSocketAddress) remoteAddress).addListener(new ChannelFutureListener()
{
@Override
public void operationComplete(ChannelFuture innerFuture)
throws Exception
{