Other Parts Discussed in Thread: ENERGIA, CC3200
Hi Jan D
Referring to this thread:-

I was also working on that, everything is working fine. But now i want to reduce the time taken by sl_connect when there is no network. I tried the solution what you suggested in the above thread. I am using non-blocking option for sl_setsockopt(). But still there is no luck.
Here is my piece of changes i made in the code:-
#Define MAX_TIMEOUT 50
long nonBlockingValue = 1;
int timeout = 0;
if (setsockopt(skt, SOL_SOCKET, SL_SO_NONBLOCKING, &nonBlockingValue, sizeof(nonBlockingValue)) < 0) {
HTTPCli_disconnect(cli);
return (HTTPCli_ESOCKETFAIL);
}
while(1){
ret = connect(skt, sa, slen);
if(ret >= 0){
setCliState(cli, INPROGRESS_FLAG, 0);
return 0; //connection established
}
if(ret == SL_EALREADY){
UtilsDelay(10000000);
if(timeout++ > MAX_TIMEOUT){
setCliState(cli, INPROGRESS_FLAG, 0);
return -2; //connection timeout
}
}
else if(ret < 0){
setCliState(cli, INPROGRESS_FLAG, 0);
return -1; //connection error
}
}