|
|
|
@ -83,7 +83,7 @@ function Network:pull(filter, timeout)
|
|
|
|
if ev ~= nil then
|
|
|
|
if ev ~= nil then
|
|
|
|
return last_msg
|
|
|
|
return last_msg
|
|
|
|
else
|
|
|
|
else
|
|
|
|
return nil, "timeout"
|
|
|
|
return nil
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
@ -118,7 +118,6 @@ function BaseControl:new(network)
|
|
|
|
self.network:start(function(remote, msg)
|
|
|
|
self.network:start(function(remote, msg)
|
|
|
|
self:_network_handler(remote, msg)
|
|
|
|
self:_network_handler(remote, msg)
|
|
|
|
end)
|
|
|
|
end)
|
|
|
|
-- Announce own presence so registers start coming in
|
|
|
|
|
|
|
|
self.network:broadcast{ty=Message.Hello}
|
|
|
|
self.network:broadcast{ty=Message.Hello}
|
|
|
|
|
|
|
|
|
|
|
|
return self
|
|
|
|
return self
|
|
|
|
@ -150,9 +149,7 @@ function BaseControl:register(name, value)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function BaseControl:finalize(waits, timeout)
|
|
|
|
function BaseControl:finalize(waits, timeout)
|
|
|
|
local self = self
|
|
|
|
|
|
|
|
if self == BaseControl then
|
|
|
|
if self == BaseControl then
|
|
|
|
-- Called as a constructor
|
|
|
|
|
|
|
|
self = BaseControl:new()
|
|
|
|
self = BaseControl:new()
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
@ -167,6 +164,7 @@ function BaseControl:finalize(waits, timeout)
|
|
|
|
verbs=verbs,
|
|
|
|
verbs=verbs,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
self.live = true
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
if #(waits or {}) ~= 0 then
|
|
|
|
if #(waits or {}) ~= 0 then
|
|
|
|
@ -210,7 +208,6 @@ function BaseControl:finalize(waits, timeout)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
self.live = true
|
|
|
|
|
|
|
|
return self
|
|
|
|
return self
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
@ -228,7 +225,6 @@ function BaseControl:close()
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
self.network:stop()
|
|
|
|
self.network:stop()
|
|
|
|
|
|
|
|
|
|
|
|
setmetatable(self, nil)
|
|
|
|
setmetatable(self, nil)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
-- }}}
|
|
|
|
-- }}}
|
|
|
|
@ -505,8 +501,6 @@ function BaseControl:_network_handler(remote, msg)
|
|
|
|
self.listeners[msg.noun][msg.id] = nil
|
|
|
|
self.listeners[msg.noun][msg.id] = nil
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
else
|
|
|
|
|
|
|
|
error("TODO: MessageType Unknown")
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
-- }}}
|
|
|
|
-- }}}
|
|
|
|
|