Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local c = require("component")
- local e = require("event")
- local i = c.internet
- local a = {...}
- local h = a[1]
- local p = a[2]
- local d = a[3]
- local s = i.connect(h, tonumber(p))
- while not s:finishConnect() do end
- b = s.write(d)
- print("TCP_SEND: "..d..", "..b.." bytes")
- e.pull("internet_ready")
- r = s.read()
- print("TCP_RECEIVE: "..r)
- if r == d then
- print("Echo success!")
- else
- print("Echo.. fail?!")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement