78 end |
78 end |
79 end |
79 end |
80 |
80 |
81 function create_component(host, component) |
81 function create_component(host, component) |
82 -- TODO check for host well-formedness |
82 -- TODO check for host well-formedness |
83 local session = session or { type = "component", host = host, connected = true, s2sout = {} }; |
83 return { type = "component", host = host, connected = true, s2sout = {} }; |
84 return session; |
|
85 end |
84 end |
86 |
85 |
87 function register_component(host, component, session) |
86 function register_component(host, component, session) |
88 if not hosts[host] or (hosts[host].type == 'component' and not hosts[host].connected) then |
87 if not hosts[host] or (hosts[host].type == 'component' and not hosts[host].connected) then |
89 components[host] = component; |
88 components[host] = component; |