Throwable failure_msg )
{
transport.close( "Proxy login failed" );
result[0] = RES_SOCKS_FAILED;
error[0] = new NetworkAdminException( "Proxy connect failed", failure_msg );
sem.release();
}
},
version,
user,
password );
}
public void
connectFailure(
Throwable failure_msg )
{
result[0] = RES_CONNECT_FAILED;
error[0] = new NetworkAdminException( "Connect failed", failure_msg );
sem.release();
}
};
TCPNetworkManager.getSingleton().getConnectDisconnectManager().requestNewConnection(
socks_address, connect_listener, ProtocolEndpoint.CONNECT_PRIORITY_MEDIUM );
}catch( Throwable e ){
result[0] = RES_CONNECT_FAILED;
error[0] = new NetworkAdminException( "Connect failed", e );
sem.release();
}
if ( !sem.reserve(10000)){
result[0] = RES_CONNECT_FAILED;
error[0] = new NetworkAdminException( "Connect timeout" );
}
if ( result[0] != RES_OK ){
throw( error[0] );