You are reading a single comment by @net-tobi and its replies. Click here to read the full conversation.
  • Yes this is as well part of the problem. My close handlers are not getting called if the line starts with \r\n or \r or \n. See here:

    var handler = function(d) {
            var s;
            if(d === 'OK') {
              s = sckt;
              at.registerLine(s + ', CONNECT OK', function() {
                at.unregister(s + ', CONNECT OK');
                socks[s] = true;
              });
              at.registerLine(s + ', CLOSED', function() {
                at.unregisterLine(s + ', CLOSED');
                socks[s] = undefined;
              });
            }
          }; 
          at.cmd('AT+CIPSTART='+sckt+',"TCP",'+JSO­N.stringify(host)+','+port+'\r\n', 10000, handler);
    

    This unfortunately happens sometimes, for example a few seconds ago I had the situation:

    ] "\r\n1, CLOSED\r\n" <--- "\r\n1, CLOSED\r\n"
    

    The close handler has not been called here :(

About

Avatar for net-tobi @net-tobi started