Part Number:CC3220
Tool/software: TI C/C++ Compiler
Hi,
For the socket connection to the data server sl_Socket() ,sl_SetSockOpt(), sl_Connect(), sl_Send(), sl_Recv(). My understanding is that none of these are blocking except for sl_Connect(). That is, sl_Connect() may hang for a long time (tens of seconds) if there are problems with connecting to the server. I believe all other calls return immediately and generate errors in callbacks if there are issues. Please confirm that for each of the five functions listed. In particular for sl_Send() I want to be sure that this does NOT wait on any TCP handshakes but returns immediately.
1. Also, for sl_Connect(), what is the timeout for making a connection and where/how do we configure that timeout?
2. I actually just ran into a problem with sl_Recv(). When there is no data on the socket this seems to be blocking! for 5 mins if i was using
int32_t status = sl_Recv(g_dataServerSockID, buf, BUFF_SIZE, 0);
I need a non-blocking receive function.
Just called sl_Recv() on the socket before sl_send i'll see its hang for 5 mins approx instaed of returning error so i tried NO MSG time out this
#define BUFF_SIZE 300
uint8_t buf[BUFF_SIZE+1];
int32_t status = sl_Recv(g_dataServerSockID, buf, BUFF_SIZE, SL_MSG_DONTWAIT); //1
if((status < 0) && (status != SL_ERROR_BSD_EAGAIN))
{
UART_PRINT("Set Non Blocking Mode: %d\r\n",status); //ERROR
}
int transfer_len = sl_Send(g_dataServerSockID, stuffed_envelope_buf, stuffed_envelope_len, 0);
then again
int32_t status = sl_Recv(g_dataServerSockID, buf, BUFF_SIZE, 0); // 2
Then i'm getting data from server if i'm calling receive function with comment 1 with NOMSGWAIT flag then i'm getting -11 error. & if i'm calling comment //2 type of recv function then code is hanging for 5 mins what can i do?