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.

CC3000: TCP connection gets closed automatically after it is idle for 60s

Hello,

I see that my TCP connection gets automatically closed by the CC3000 after it is idles for 60s. This happens while I block in recv() and it also happens when I am blocked in select(). (I am using the MSP430FRAM+CC3000 Kit.)

The remote end (the PC side for example) receives a 'recv() returned 0' which means that the socket was closed in a controlled way at the remote end.

The blocking CC3000 recv() returns an error (-1) then.

The blocking CC3000 select() (without a timeout) does not return at all, although the readfds and the errorfds bit is set. 

The 60s timeout can be shortened by calling setsockopt(sd, SOL_SOCKET, SOCKOPT_RECV_TIMEOUT, ...), But I cannot make it longer. This indicates that the timeout is indeed caused by the CC3000 (and not by my access point for example).

Is there a way to set the TCP idle timeout to really high values (1 hour or more)?

The select() call behavior is wrong in my opinion and should be fixed.

Cheers,

Johannes

  • Hi,

    Please try to set the socket inactivity timeout with this API:

    netapp_timeout_values(unsigned long *aucDHCP, unsigned long *aucARP,unsigned long *aucKeepalive, unsigned long *aucInactivity);

    Use aucInactivity to set the socket inactivity timeout you wish.

    I will review the select() behavior and return a feedback on this subject.

     

    Yael

     

  • Hi Yael,

    thanks for the fast answer. I can indeed set the inactivity to high values using netapp_timeout_values(). This solves my problem.

    Regarding the select() behavior I think the best would be if select() either returns with -1 or returns with an error in the errorfds bits when the connection is closed as this is an important event one would always need to deal with. (recv() returns -1 BTW which is ok).

    Cheers,

    Johannes

  • Hi Johannes,

     We will look into the select() behavior, your suggestion sounds reasonable.

     

    Thanks,
    Alon.S