braga_firmware/tests/client.lua
2026-03-08 16:03:33 +04:00

16 lines
341 B
Lua

local host, port = "meteo.ulgrad.ru", 4999
local socket = require("socket")
local tcp = assert(socket.tcp())
tcp:connect(host, port);
--note the newline below
tcp:send("thunder!");
while true do
local s, status, partial = tcp:receive()
print(s or partial)
print(status)
if status == "closed" then break end
end
tcp:close()