Page 1 of 1

How to Check Whether TCP Client is Connected?

Posted: Mon Feb 25, 2019 8:21 pm
by Ozgun Kanal
Hi all, hope you are well!

I'm working on a project which ESP32 works as TCP transparent Wifi-Uart Passthrough. Im using ESP32 as AP and connecteing as a client via a terminal program(hercules) on a specific IP address and port number . However, how can I understand the time when TCP clients is disconnected from terminal program(while PC is still connected as STA)

Can you share an example for that? As far as I know, in all AP examples, ESP32 closes the client socket after data is received/sent. Do I miss something? Thank you in advance!

Re: How to Check Whether TCP Client is Connected?

Posted: Wed Mar 13, 2019 6:18 am
by Ozgun Kanal
As far as I observed, the socket api has a blocking structure. There are 2 lwip apis remaning: lwip raw api and netconn api. Esp doesnt support raw api to be threadsafe. Therefore, using netconn api with callback solves issue.