Hi, i have experienced connecting issue when using Appwarp, the onConnectDone callback
is not always fired, i tried to reproduce the issue by repetitively connect and disconnect
to appwarp using the code snippet below, here is the logs printed,
Initialization result 0
Connecting...
onConnectDone: 0
AppWarpTrace :1464683580186:Exception class java.lang.IndexOutOfBoundsException in thread run null
onDisconnectDone: 0
Connecting...
As you can see the onConnectDone callback is not fired again after several success attempts and the process is stucked,
no timeout or error noticed, please help.
public class ForAppwarpTesting implements ConnectionRequestListener {
private WarpClient _warpInstance;
private String _appKey = API_KEY;
private String _secretKey = SECRET_KEY;
public void init(){
WarpClient.enableTrace(true);
int result = WarpClient.initialize(_appKey, _secretKey);
System.out.println("Initialization result " + result);
try {
_warpInstance = WarpClient.getInstance();
_warpInstance.addConnectionRequestListener(this);
connect();
} catch (Exception e) {
e.printStackTrace();
}
}
private void connect(){
String username = String.valueOf(System.currentTimeMillis());
System.out.println("Connecting...");
_warpInstance.connectWithUserName(username);
}
@Override
public void onConnectDone(ConnectEvent connectEvent) {
System.out.println("onConnectDone: " + connectEvent.getResult());
_warpInstance.disconnect();
}
@Override
public void onDisconnectDone(ConnectEvent connectEvent) {
System.out.println("onDisconnectDone: " + connectEvent.getResult());
connect();
}
@Override
public void onInitUDPDone(byte b) {
}
}