This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Changing socket timeout on the CC3000

Hi,

I am using the CC3000 in UDP mode and an MSP430 controller.  The mode I am using it in is to open a socket, binding it, and then polling it (using the recvfrom function) until I receive data over the socket.  I will be needing to do other work with the MSP430 in between polling cycles.

I have used the setsockopt to change the SOCKOPT_RECV_TIMEOUT to 0 in order to have the recvfrom function return in a reasonable time to allow other work to be done by the MSP430.

There has been some indications in this forum that the SOCKOPT_RECV_TIMEOUT is used to change the timeout of the socket itself but that is not my experience.  I have found that if the socket is inactive for roughly 60 seconds, that the socket will close automatically.  Both the recvfrom and sendto functions do reset the timeout count for the socket.  However, there are times when I will go 60 seconds between function calls and the socket shuts down.  I don't want this to happen.  Once of these cases is when I am debugging and stepping through code.  Is there a way to change the socket timeout value?  An infinite timeout value would be preferred in my application.

Thanks,

Brent

  • Hello Brent,

    you can use the function netapp_timeout_values:

            unsigned long aucDHCP       = 14400;
            unsigned long aucARP        = 3600;
            unsigned long aucKeepalive  = 10;
            unsigned long aucInactivity = 0;

            netapp_timeout_values(&aucDHCP, &aucARP, &aucKeepalive, &aucInactivity);

    The important parameter is the aucInactivity. Setting it to 0 disable the socket timeout.

    Best regards,

    Martin



  • Hello Martin,

    How can i do this from LM3s9b96 via SPI mode.

    I have connected the CC3000 to LM3S9B96 through SPI and want to set the aucInactivity to 0.

    Where is the parameter stored in NVMEM? is there any document or ref code to understand the procedure.

    Thanks And regards,

    NIlesh Mane