title: ESP8266 send and receive sockets
body: <p>I'm new to NodeMCU programming for ESP8266. I need to send strings to the server and receive response strings. So I wrote some code, but it doesn't work properly. My program works through time, and then displays a message that the memory is full. Can you help me?</p>
  
  <pre><code>---------init funсtion-----------------
  wifi.setmode(wifi.STATION)
  wifi.sta.config("TP-LINK_ROBOT","63793246")
  wifi.sta.connect()
  ---------------------------------------------
  
  function hello (sck,c)
     print (c)
     sk:close()
     if c == "Thank you" then
     print("Great!")
     end 
  end
  
  function test()
  sk=net.createConnection(net.TCP, 0)
  sk:on("receive", hello)
  sk:on("sent", function(sck)  end)
  sk:connect(9999,"192.168.0.100")
  sk:send("HELLO")
  print("sent to server")
  end
  
  test()
  </code></pre>