• Hi,

    I'm using net.connect to send and receive raw data to/from server. Client (esp8266) gets data, creates a response and sends to server. Then server asks another thing.

    This works as intended till a point, then esp8266 gets a data from server (a stringified JSON), prepares response, then stucks. Here is the last status of clientSocket that is created via net.connect:

    ={ "type": 0, 
      "#onconnect": function (e) { ... }, 
      "opt": { 
        "host": "aktos.io", 
        "port": 1235 }, 
      "sckt": 54, "conn": true, 
      "dSnd": "{\"status\":{\"coinI" ... "cd1234\"},\"hb\":0}}", 
      "#ondata": function (n) { ... }, 
      "#onend": function () { ... }, 
      "dRcv": undefined }

    the dSnd isnt empty. Is that the root of the problem? Should I flush it?

  • dSnd should automatically send, if the ESP8266 thinks it is capable of receiving data. Are you sure that the WiFi connection hasn't dropped out or something?

  • No, the connection might be dropped... Can I detect a connection drop with a callback or something?


    We have another RTFM situation here: http://www.espruino.com/Reference#l_Wifi­_disconnected


    That event (Wifi.on('disconnected', ...)) is not working for me.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview

net.connect's socket can not send data after some point of communication

Posted by Avatar for ceremcem @ceremcem