This commit is contained in:
kepler155c
2018-11-05 00:46:07 -05:00
parent 6de154dc48
commit d113b1da1a
3 changed files with 10 additions and 4 deletions

View File

@@ -38,6 +38,7 @@ end
local config = {
monitor = 'type/monitor',
activityMonitor = 'none',
remoteDefaults = { },
}
Config.load('milo', config)

View File

@@ -151,8 +151,10 @@ function page:sendRequest(data)
if r and not r.msg then
self:setStatus('connected ...')
else
msg = r and r.msg or 'Timed out'
socket:close()
socket = nil
self:setStatus(r.msg)
break
end
end
end

View File

@@ -20,7 +20,7 @@ local function getManipulatorForUser(user)
end
local function client(socket)
_G._debug('connection from ' .. socket.dhost)
_G._debug('REMOTE: connection from ' .. socket.dhost)
local user = socket:read(2)
if not user then
@@ -29,12 +29,15 @@ local function client(socket)
local manipulator = getManipulatorForUser(user)
if not manipulator then
_debug('REMOTE: Manipulator with introspection module bound with user not found. Closing connection.')
socket:write({
msg = 'Manipulator not found'
})
socket:close()
return
end
_debug('REMOTE: all good')
socket:write({
data = 'ok',
})
@@ -110,12 +113,12 @@ local function client(socket)
end
until not socket.connected
_G._debug('disconnected from ' .. socket.dhost)
_G._debug('REMOTE: disconnected from ' .. socket.dhost)
end
if device.wireless_modem then
Event.addRoutine(function()
_G._debug('Milo: listening on port 4242')
_G._debug('REMOTE: listening on port 4242')
while true do
local socket = Socket.server(4242)
Event.addRoutine(function()