How to Check Whether TCP Client is Connected?

Ozgun Kanal
Posts: 2
Joined: Mon Feb 25, 2019 2:30 pm

How to Check Whether TCP Client is Connected?

Postby Ozgun Kanal » Mon Feb 25, 2019 8:21 pm

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!

Ozgun Kanal
Posts: 2
Joined: Mon Feb 25, 2019 2:30 pm

Re: How to Check Whether TCP Client is Connected?

Postby Ozgun Kanal » Wed Mar 13, 2019 6:18 am

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.

Who is online

Users browsing this forum: No registered users and 117 guests