Now we can re-use the RPC method<->result code in the TcpServer side
which will face wallets. Phew! Took me long enough!
It's a minimal JSON-RPC protocol impl.. but it'll do.
The 1 nice bit is the Schema spec I came up with which more-or-less
works well enough as a first-pass validatior.
Further passes are needed in interested client code, but the initial
pass validation can be done in a thread so as to not waste the main
thread's time validating json or dict key presence/absense. Yay.
- Util::RunInThread to run a lambda in a thread
- App exit handling cleanup
- EXMgr uses an id for clients now
- EXMgr keeps track of lagging clients
- EXMgr more aggressive with reconnects if no valid exclients
- Nits and refactorings and misc. cleanup
- Made the stale timeout be 2 mins now
- Check clients runs every 1 minute
- Added 'Controller' ABC which EXMgr is one of and the TcpServer will be
another.
We weren't exactly thread safe. Fixed to not touch socket from main
thread. Also documented what should be called from which thread.
Hopefully we are solid now.