Hi,
We are using the TI’s CC31xx WiFi chip set.
Our Application uses TCP communication for which face instabilities in establishing a connection.
Our Application flow is :
1. socketId = sl_Socket(SL_AF_INET, SL_SOCK_STREAM, SL_IPPROTO_TCP);
2. SlSockNonblocking_t enableOption; enableOption.NonblockingEnabled = 1; sl_SetSockOpt(socketId, SOL_SOCKET, SL_SO_NONBLOCKING, &enableOption, sizeof(enableOption));
3. localAddr_ldt.sin_family = SL_AF_INET; localAddr_ldt.sin_port = serverPort; localAddr_ldt.sin_addr.s_addr = SL_INADDR_ANY; sl_Bind(socketId, (SlSockAddr_t *) &localAddr_ldt, sizeof(localAddr_ldt)) < 0);
4. serverAddr.sin_addr.s_addr = *ipAddrPtr; serverAddr.sin_family = SL_AF_INET; serverAddr.sin_port = port; ret = sl_Connect(socketId, (const SlSockAddr_t *) &serverAddr, sizeof(serverAddr));
Step 1 to 3 are always successful.
The instability that we see is, sl_Connect returns SL_EALREADY (-114).
Then we retry (call sl_Connect) every 100 ms again and again.
After ~ 10 sec, we receive SL_ECONNREFUSED (-111).
Our questions are :
1. Is the retry time of 100 ms is acceptable for sl_Connect? Or is there a recommendation for the same?
2. What are the possible causes for the SL_ECONNREFUSED? (NOTE : There is no firewall issues and such at the server end. This software does work. We only have instabilities at times.)
P.S.
We use Enterprise WPA2 network connection.
This issue is faced in few of our customer sites.