Hi,
Now I use the CC3000 as a tcp client, and PC as a tcp server, I found that when I unplug the networkcable,
the CC3000 does't detect the netoff, what can I do to reconnect to the PC's tcp server again?
thanks
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.
Hi,
Now I use the CC3000 as a tcp client, and PC as a tcp server, I found that when I unplug the networkcable,
the CC3000 does't detect the netoff, what can I do to reconnect to the PC's tcp server again?
thanks
Hello,
When sending a packet fails, have you tried closing the socket then connecting again?
Thanks,
Aaron
Hi,
Yes, I did as you said .But now the question is that when I unplug the networkcable, the send() function doesn't return -1.
So the MCU doesn't know the network is broken,and it will not call closesocket() and connect to the server again .
And the MCU will call send() many times ,then the send() function returns -1.
Is this the tcpip's limitation? Does CC3000 has a good solution?
Thank you.
Hi,
If you need something reliable for every packet even after forceful disconnection, you can try implementing a system which requires a reply back after every packet sent. Pinging right before sending may work most of the time also, but would not be 100% reliable.
Thanks,
Aaron
Hi,
Thanks for your fast reply . As you said ,now my tcp client sends messages to the server timely and waits for response .
If not recieving any response ,then the CC3000 rebulid socket and reconnect to the server again.
thanks