I'm creating a pull request, which has a slew of changes... Mostly fixes to the esp8266 socket stuff but also adds errors to the standard socketserver, i.e. socket and http classes. When in doubt I looked at node.js, so a socket error event handler receives one parameter, which is an object with a code and a message. I'm pretty happy with the client socket test coverage, but the server test coverage is very thin. So I expect there will be some bugs to sort out. The server side has almost no changes at the socketserver level, so I'm hoping I didn't break anything for non-esp8266 versions.
The open issues I have with all this:
can anyone run some sanity tests on other platforms?
the http request object error handler is not invoked on HTTP errors (such as a 404), but according to the node.js docs it should be and I think it would be really helpful. Thoughts? I suppose I would set code to an error code for "http error" and then add a status field with the http statusCode? (I have never used node.js and the docs are not explicit about this.)
I have not dealt with printing errors if there is no error handler.
I can not load the MQTT library on the esp8266, it runs out of memory, (I'm not at all suprised), so I'm still expecting to write a C library...
Phew, it feels like I can see the light at the end of the tunnel...
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.
I'm creating a pull request, which has a slew of changes... Mostly fixes to the esp8266 socket stuff but also adds errors to the standard socketserver, i.e. socket and http classes. When in doubt I looked at node.js, so a socket error event handler receives one parameter, which is an object with a
code
and amessage
. I'm pretty happy with the client socket test coverage, but the server test coverage is very thin. So I expect there will be some bugs to sort out. The server side has almost no changes at the socketserver level, so I'm hoping I didn't break anything for non-esp8266 versions.The open issues I have with all this:
code
to an error code for "http error" and then add astatus
field with the http statusCode? (I have never used node.js and the docs are not explicit about this.)Phew, it feels like I can see the light at the end of the tunnel...