transition to kernel
This commit is contained in:
@@ -22,6 +22,7 @@ Event.addRoutine(function()
|
||||
-- need to prevent multiple shares
|
||||
if not peripheral then
|
||||
print('peripheral: invalid peripheral ' .. uri)
|
||||
socket:write('Invalid peripheral: ' .. uri)
|
||||
else
|
||||
print('peripheral: proxing ' .. uri)
|
||||
local proxy = {
|
||||
@@ -62,6 +63,11 @@ Event.addRoutine(function()
|
||||
print('peripheral: lost connection from ' .. socket.dhost)
|
||||
break
|
||||
end
|
||||
if not _G.device[peripheral.name] then
|
||||
print('periperal: detached')
|
||||
socket:close()
|
||||
break
|
||||
end
|
||||
if peripheral[data.fn] then
|
||||
socket:write({ peripheral[data.fn](table.unpack(data.args)) })
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user