Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

public abstract class Connection {

private static final String TAG = "TestConnection";
protected static final String TAG = "TestConnection";
final static int TIMEOUT = 7000;
final static int PORT = 3000;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
import com.piasy.kmp.socketio.socketio.IO;
import com.piasy.kmp.socketio.socketio.Manager;
import com.piasy.kmp.socketio.socketio.Socket;
import com.piasy.kmp.xlog.Logging;

import kotlin.Unit;
import kotlinx.io.bytestring.ByteString;
import kotlinx.serialization.json.*;
Expand Down Expand Up @@ -454,7 +456,7 @@ public void reconnectDelayShouldIncreaseEveryTime() throws InterruptedException
opts.reconnection = true;
opts.timeout = 0;
opts.reconnectionAttempts = 3;
opts.setReconnectionDelay(100);
opts.setReconnectionDelay(1000);
opts.setRandomizationFactor(0.2);
final Manager manager = new Manager(uri(), opts, TestUtil.testScope());
socket = TestUtil.socket(manager, "/timeout");
Expand All @@ -468,6 +470,7 @@ public void reconnectDelayShouldIncreaseEveryTime() throws InterruptedException
@Override
public void call(Object... args) {
startTime[0] = new Date().getTime();
Logging.INSTANCE.info(TAG, "reconnectDelayShouldIncreaseEveryTime startTime " + startTime[0]);
}
});
manager.on(Manager.EVENT_RECONNECT_ATTEMPT, new Emitter.Listener() {
Expand All @@ -476,6 +479,8 @@ public void call(Object... args) {
reconnects[0]++;
long currentTime = new Date().getTime();
long delay = currentTime - startTime[0];
Logging.INSTANCE.info(TAG, "reconnectDelayShouldIncreaseEveryTime currentTime "
+ currentTime + ", delay " + delay + ", prevDelay " + prevDelay[0]);
if (delay <= prevDelay[0]) {
increasingDelay[0] = false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import kotlinx.serialization.json.JsonElementBuildersKt;
import kotlinx.serialization.json.JsonElementKt;
import kotlinx.serialization.json.JsonObject;
import org.json.JSONObject;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
Expand Down
Loading