OpenComputers Von Neumann Machine Programs
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
577 B

local Socket = require("socket")
local net = require("net")
local computer = computer or require("computer")
local event = event or require("event")
local os = os or require("os")
pkt, err = net.recv{100}
local s = Socket(pkt.raddr, pkt.port)
interrupted = false
local function interrupt()
interrupted = true
end
local n = event.listen("interrupted", interrupt)
while not interrupted do
m = s:recieve()
if m ~= nil then
computer.beep(2000)
for k, v in pairs(m) do print(k, v) end
end
computer.beep(100)
end
s:close()
event.cancel(n)