void *arg : pointer corresponding structure espconn. This pointer may be
different in different callbacks, please don’t use this pointer directly to
distinguish one from another in multiple connections, use remote_ip and
remote_port in espconn instead.
How is this supposed to work?
Take the following situation:
- I get an espconn_connect_callback(arg), where arg points to an espconn struct, let's call this "espconn1"
- I then receive an espconn_recv_callback(arg), where arg points to a different espconn struct, call this "espconn2"
- In the receive callback I want to send a response, I thus need to call espconn_sent, do I use espconn1 or espconn2 for this?
- After the receive callback completes, I have a timer firing and I need to send some more data on this same connection, so I need to call espconn_sent again, do I now use espconn1 or esconn2 for this?