This would request a connection ... when the connection is made, it would send some data ... and when the data has been sent ... perform a close of the connection. However, since the current base code invokes the connection callback immediately after asking for a connection ... this is before the connection has been formed and we are not yet ready to perform a send operation. In the ESP8266 world, the connection operation (at the ESP8266 SDK level) is always non blocking and one supplies a callback function pointer (in C) that will be invoked when the connection has been completed. It is then that I would have imagined that the net.connect() callback would have been ready to be called.
I'm not seeing how post #8 changes that story....?
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
@Gordon,
I'm afraid I'm not following the meat in post #8. In JavaScript (pseudo code), I want to execute something like:
This would request a connection ... when the connection is made, it would send some data ... and when the data has been sent ... perform a close of the connection. However, since the current base code invokes the connection callback immediately after asking for a connection ... this is before the connection has been formed and we are not yet ready to perform a
send
operation. In the ESP8266 world, theconnection
operation (at the ESP8266 SDK level) is always non blocking and one supplies a callback function pointer (in C) that will be invoked when the connection has been completed. It is then that I would have imagined that thenet.connect()
callback would have been ready to be called.I'm not seeing how post #8 changes that story....?
Neil