Skip to content

Commit

Permalink
tweak http timeouts so sideshift does not timeout (#881)
Browse files Browse the repository at this point in the history
  • Loading branch information
m2049r authored Jan 7, 2023
1 parent ac1ea05 commit cc7cdb3
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions app/src/main/java/com/m2049r/xmrwallet/util/NetCipherHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@
@RequiredArgsConstructor
public class NetCipherHelper implements StatusCallback {
public static final String USER_AGENT = "Monerujo/1.0";
public static final int HTTP_TIMEOUT = 1000; //ms
public static final int HTTP_TIMEOUT_CONNECT = 1000; //ms
public static final int HTTP_TIMEOUT_READ = 2000; //ms
public static final int HTTP_TIMEOUT_WRITE = 1000; //ms
public static final int TOR_TIMEOUT_CONNECT = 5000; //ms
public static final int TOR_TIMEOUT = 2000; //ms

Expand Down Expand Up @@ -117,9 +119,9 @@ private void createTorClient(Intent statusIntent) {
private void createClearnetClient() {
try {
client = new OkHttpClient.Builder()
.connectTimeout(HTTP_TIMEOUT, TimeUnit.MILLISECONDS)
.writeTimeout(HTTP_TIMEOUT, TimeUnit.MILLISECONDS)
.readTimeout(HTTP_TIMEOUT, TimeUnit.MILLISECONDS)
.connectTimeout(HTTP_TIMEOUT_CONNECT, TimeUnit.MILLISECONDS)
.writeTimeout(HTTP_TIMEOUT_WRITE, TimeUnit.MILLISECONDS)
.readTimeout(HTTP_TIMEOUT_READ, TimeUnit.MILLISECONDS)
.build();
Helper.ALLOW_SHIFT = true;
} catch (Exception ex) {
Expand Down

0 comments on commit cc7cdb3

Please sign in to comment.