Lua Socket Lib Question
snippet in lua

Lua Socket Lib Question

user8728

require("socket");
local soc=socket.tcp();
local hello="hi stack overflow";
local myIP="192.168.1.1";
local myPort = 2000;



local stat,err=socket:connect(myIP, myPort)
if not stat then
   error(err)
else
    -- Main
    while not err do
        err = socket:send(hello)
        socket.sleep(10)
    end
end