After some thought, I think I really don't like the name of the function called "espconn_accept". What this function does is cause the ESP8266 to start listening on a local port for new incoming requests. Essentially making the ESP8266 a server. When we study the sockets API, we find that the equivalent function call to achieve this task is called "listen". So my suggested/recommended new name for this function would be "espconn_listen".
So where then did the "accept" name come from? The answer is that in sockets API there is a partner function called "accept". When executed against a socket that has previously had "listen" called against it, what it does is block until a partner actually attempts to connect. In the ESP8266, there is no equivalent. Instead, after "espconn_accept" is called, the ESP8266 immediately starts listening and when a partner connects, we wake up in the connect callback. So ... is "espconn_accept" a sockets "listen()" call or a sockets "accept()" call? My mind says that it is MUCH closer to a "listen()" call.
Login
Newbies Start Here
Are you new to ESP8266?
Unsure what to do?
Dunno where to start?
Start right here!
Latest SDK
Documentation
Complete listing of the official ESP8266 related documentation release by ESPRESSIF!
Must read here!
- All times are UTC+08:00
- Top
- Delete all board cookies
About Us
Espressif Systems is a fabless semiconductor company providing cutting-edge low power WiFi SoCs and wireless solutions for wireless communications and Internet of Things applications. We are the manufacturer of ESP8266EX.