JAndrassy / TelnetStream

Arduino Stream implementation over Telnet for OTA logging and debugging
GNU Affero General Public License v3.0
164 stars 17 forks source link

Test if someone is connected #41

Closed arjenv closed 3 months ago

arjenv commented 3 months ago

Not an issue, but i was wondering if there is a command to test if someone is connected. I can test e.g.

while(TelnetStream.available()) ....

but is there a test to determine if anyone has even opened the telnet stream?

Got an application in which the telnet is scarcely used, so a test for a client would be more time conserving I guess....

Thanks!

JAndrassy commented 3 months ago

Arduino's WiFiServer / EthernetServer handles the connected clients for print, but has in general no function to know that there are some clients connected. It only relieves a client if the client sends some data.

some networking libraries have hasClient(). It would be available if you use TelnetPrint,