3 -- Include L4 functionality
4 local L4 = require("L4");
6 -- Some shortcut for less typing
7 local ld = L4.default_loader;
9 -- Namespace to exchange objects
10 -- Reserve the name the server will use later, so that
11 -- the client knows that it is waiting for an object
12 -- intended to be created later.
13 local ns = ld:create_namespace({ the_object = "placeholder" });
15 -- The server program, getting the namespace with extended
16 -- access rights (read + write)
17 ld:start({ caps = { namespace = ns:m("rw") },
18 log = { "server", "cyan" } },
21 -- The client program, getting the 'calc_server' channel to be able to talk
22 -- to the server. The client will be started with a green log output.
23 -- Note, the client only gets read rights for the namespace, so it may
24 -- query, but cannot register own objects.
25 ld:start({ caps = { namespace = ns:m("r") },
26 log = { "client", "green" } },