Hi Again,
i want to ask about RunJavaCode without callback on Unity.
here's my code :
for(int i = 0 ; i < 3 ; i ++)
{
try{
jResult = customCodeService.RunJavaCode(_name,_json);
resultRunJavaCode = jResult.ToString();
flag=1;
i=4;
}
catch(Exception ex)
{
if(!ex.ToString().Contains("Bad Request"))
{
i=4;
}
exception = ex;
}
}
i tested this code in case my connection disconnected.
for the 1st attempt, run java code will trigger exception, so i can determine the connection is failed and suggest to user to retry.
when user trying to retry the connection (2nd attempt) my code stuck on runJavaCode. it doesnt trigget the exception and cannot execute command below it.
after i read about runJavaCode, i think this connection got trap on exception and do looping. so i can't decide the connection is success or not.
any suggestion for this?
i think it would be nice if you add setTimeOut for RunJavaCode, and if time execution reach timeOut limit, it will trigger exception.
note : i'm not using RunJavaCode with callback, because i need to run the code in thread. my data that transferred is encrypted. so i need decrypting the data in thread.
Thank You