Time services are moved into the DNS crate so that the EC
update thread can remain running and consuming resources.
The problem is that we are out of connections in the connection table
(it's limited to 32 total), and in order to allow a "force update"
function for the EC we need to hold on to more connections than
are possible.
The "time" service is fairly self contained and could be moved
elsewhere. It sort of logically fit in the status crate initially
because the status crate manages preferences and displays the
current time on the screen, but it's modular enough that we could
put the service in any process space, at a minor trade-off of
the time UX function being public. This was avoided for a long
time because it could be a security risk but in the end the records
that store time zone and offsets are in the PDDB, which are accessible
to anyone who knows the names of these records, which is in the end
equivalent to knowing the name of the time UX server.
Thus the time UX server was made a dynamically registered "public"
server with just one connection (so only a minor downgrade in security,
the only vector exists in between boot and when the time servers
connect up), and the time server itself was slotted into the DNS
server's process space.
The DNS server was chosen because the DNS service itself is
very lightweight and will be unlikely to grow any heavier, so there
is little risk in merging the time service into the DNS crate's
process connection allocation.
Total bodge -- we lop off the TCP stack at the Xous API level, and
substitute it with a native host TCP stack.
Caveat hacker: this means that a lot of OS-specific net properties
will carry through to the hosted mode emulation. This is adequate
for "smoke testing" a build but do not be shocked, *shocked* if
there are more bugs to be found because of some weird host integration
issue.
yes, i know there is some fancy way to code this with iterators.
i don't like that way. this ways is easier for me to understand
and verify. It works now.
Sometimes, Rust sucks a bit. It's ok, you can cry.