-
- All Implemented Interfaces:
-
co.electriccoin.lightwallet.client.util.Disposable
public final class TorClient implements Disposable
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classTorClient.Companion
-
Method Summary
Modifier and Type Method Description <ERROR CLASS>dispose()final TorClientisolatedTorClient()Returns a new isolated TorClienthandle.final <ERROR CLASS>setDormant(TorDormantMode mode)Changes the client's current dormant mode, putting background tasks to sleep or waking them up as appropriate. final JniHttpResponseByteshttpGet(String url, List<JniHttpHeader> headers, Integer retryLimit)final JniHttpResponseByteshttpPost(String url, List<JniHttpHeader> headers, ByteArray body, Integer retryLimit)final BigDecimalgetExchangeRateUsd()final PartialTorWalletClientcreateIsolatedWalletClient(String endpoint)Connects to the lightwalletd server at the given endpoint. final PartialTorWalletClientcreateWalletClient(String endpoint)Connects to the lightwalletd server at the given endpoint. -
-
Method Detail
-
dispose
<ERROR CLASS> dispose()
-
isolatedTorClient
final TorClient isolatedTorClient()
Returns a new isolated
TorClienthandle.The two
TorClients will share internal state and configuration, but their streams will never share circuits with one another.Use this method when you want separate parts of your program to each have a
TorClienthandle, but where you don't want their activities to be linkable to one another over the Tor network.Calling this method is usually preferable to creating a completely separate
TorClientinstance, since it can share its internals with the existingTorClient.
-
setDormant
final <ERROR CLASS> setDormant(TorDormantMode mode)
Changes the client's current dormant mode, putting background tasks to sleep or waking them up as appropriate.
This can be used to conserve CPU usage if you aren’t planning on using the client for a while, especially on mobile platforms.
-
httpGet
final JniHttpResponseBytes httpGet(String url, List<JniHttpHeader> headers, Integer retryLimit)
-
httpPost
final JniHttpResponseBytes httpPost(String url, List<JniHttpHeader> headers, ByteArray body, Integer retryLimit)
-
getExchangeRateUsd
final BigDecimal getExchangeRateUsd()
-
createIsolatedWalletClient
final PartialTorWalletClient createIsolatedWalletClient(String endpoint)
Connects to the lightwalletd server at the given endpoint.
This client is isolated from any other Tor usage, and queries made with this client are isolated from each other (but may still be correlatable by the server through request timing, if the caller does not mitigate timing attacks).
-
createWalletClient
final PartialTorWalletClient createWalletClient(String endpoint)
Connects to the lightwalletd server at the given endpoint.
This client is isolated from any other Tor usage. Queries made with this client are not isolated from each other; use
createIsolatedWalletClient()if you need this.
-
-
-
-