in ESP wifi libraries available() does what accept() in Ethernet.
Thanks! Is that documented anywhere? The page for the ESP8266 Server class just links to the available() method for the Arduino WiFi library.
Sorry, I don't understand the answer. Or rather, it seems like a re-statement of the question: how do I get a session ID for a Client?
I tried to point you to session cookies. Generate the ID on your server and add it in the first answer in the HTTP header (set cookie). https://en.wikipedia.org/wiki/HTTP_cookie
What I'm doing has nothing to do with HTTP. I'm writing a 9P server, but really that shouldn't matter. This is not a protocol issue; this is a much more fundamental API issue.My interpretation of the documentation for available() is that it just gives you data from all your clients jumbled up, and there is no way to tell them apart. What I'm trying to find out is whether it's really as broken as it seems, or is there some way to work around this apparent limitation that I'm not seeing?
let's chat about WiFiServer Arduino API compatibility. The server.available() should return first client with data available. https://www.arduino.cc/en/Reference/WiFiServerAvailable (esp8266 doc points there). ESP8266WiFi library now does what EthernetServer.accept() method does https://www.arduino.cc/en/Reference/EthernetServerAccept. Could it be changed for 3.0? Rename available() to accept() and a new server.available() implemented to store references to all clients and then return the first one with data available?
I hope I explained it. I started a chat with esp8266 core developers:
Yes, thanks, I understood what you said. I was replying to the other poster.Although I'm glad that Ethernet and ESP8266 can do what I want, there are still a bunch of other WiFi libraries out there, such as WiFi, WiFi101, and WiFiNINA. Ideally, I'd like my code to be as portable as possible. But it sounds like I'll have to stick to Ethernet and ESP8266, because it seems that it isn't possible to write a multi-client server with the other libraries.
UIPEthernet and my EthernetENC for enc28j60 have accept()my WiFiEspAT library has accept()