Am working on the port of Espruino to an ESP8266 and have found something I am not understanding. If I form a TCP socket connection to a partner and the invoke the "end()" method on the socket I am finding that the request to disconnect doesn't actually happen until after I try and transmit something further. For example:
var n = require("net");
var s = n.connect({
host: "192.168.4.2",
port: 25867
}, function(req) {
print("Connected!: " + JSON.stringify(req));
req.end();
});
doesn't cause the socket connection issued from the ESP8266 to be disconnected until I try the following:
var n = require("net");
var s = n.connect({
host: "192.168.4.2",
port: 25867
}, function(req) {
print("Connected!: " + JSON.stringify(req));
req.end();
req.write("We should be already disconnected");
});
Unfortunately, I don't have a real Espruino board to test against so I can't tell if this is how it works on the real Espruino or whether I have broken something in the ESP8266 implementation.
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.
Am working on the port of Espruino to an ESP8266 and have found something I am not understanding. If I form a TCP socket connection to a partner and the invoke the "end()" method on the socket I am finding that the request to disconnect doesn't actually happen until after I try and transmit something further. For example:
doesn't cause the socket connection issued from the ESP8266 to be disconnected until I try the following:
Unfortunately, I don't have a real Espruino board to test against so I can't tell if this is how it works on the real Espruino or whether I have broken something in the ESP8266 implementation.