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.

CC3220MOD: how to know whether TCP connection is still alive by at command

Part Number: CC3220MOD

Dear TI, 

    I have setup a tcp socket in cc3220 by at command, then HOST can connect to this socket.  But I meet a problem that how to know whether the host is still connected with this session.

I can't find such information from at command manual.   

BRs

Leanshaw Zhao 

  • Hi Leanshaw,

    If you call recv and it returns 0 it means the socket is closed.

    Jesu

  • Hi Jesu,

    From my test, there are four type of response,  which one means that the socket is closed?

    1. "AT+Recv=1,0,200

    OK

    +recv:1,0,0,

    OK

    "

    2."AT+Recv=1,0,200

    OK

    "

    3. "AT+Recv=1,0,200

    OK

    ERROR: process command,-9

    "

    4."AT+Recv=1,0,200

    OK

    +recv:1,0,2,ls

    OK

    "

    BRs

    Leanshaw

  • Hi Leanshaw, 

    1,3 and 4 is just data about the socket. First number is the socket descript, then format, length and finally data if any. You can see this yourself in the code.

    Regarding you question, if calling AT+Recv is not enough you can try using AT+send with the same socket. If it is closed you should get an error back. Let me know how that works for you.

    Jesu