I am trying to create TCP client in lua
local host, port = HOST, PORT
local socket = require("socket")
client = socket.tcp();
client:connect(host, port);
client:send("Hello User");
this works fine but when i add
while true do
local s, status, partial = client:receive()
print(s or partial)
if status == "closed" then break end
end
to read data from socket it block total execution of code.