Lua TCP/IP simple Client Server connection
问题 I'm looking for a simple client-server connection in Lua. Due to bad online documentation I'm quite helpless. I found two threads here in stackoverflow but they didn't help much. Here is what I have so far: Client: local socket = require("socket") local host, port = "192.168.100.47", 51515 local tcp = assert(socket.tcp()) tcp:connect(host, port); tcp:send("hello world\n"); while true do local s, status, partial = tcp:receive() print(s or partial) if status == "closed" then break end end tcp