this.circuitManager = circuitManager;
}
public Stream getStreamTo(String onion, int port) throws OpenFailedException, InterruptedException, TimeoutException {
final HiddenService hs = getHiddenServiceForOnion(onion);
final HiddenServiceCircuit circuit = getCircuitTo(hs);
try {
return circuit.openStream(port, HS_STREAM_TIMEOUT);
} catch (StreamConnectFailedException e) {
throw new OpenFailedException("Failed to open stream to hidden service "+ hs.getOnionAddressForLogging() + " reason "+ e.getReason());
}
}