Commit graph

14 commits

Author SHA1 Message Date
Calin Culianu
faeb64207f Finally.. finished refactoring out the RPC bits.
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.
2019-04-30 19:21:47 +03:00
Calin Culianu
5e4aa2d9f9 renamed boilerplate_disconnect to disconnect 2019-04-30 17:09:07 +03:00
Calin Culianu
06d7dc5ea7 added more diagnostic print msgs to tract disconnections and socket lifecycle, etc 2019-04-30 13:43:34 +03:00
Calin Culianu
71a21d75a2 nit 2019-04-30 13:32:16 +03:00
Calin Culianu
cf3cbc5fdb nits 2019-04-30 13:31:56 +03:00
Calin Culianu
463b3d00b9 intermediate commit 2019-04-30 13:18:05 +03:00
Calin Culianu
c28b9221e3 renamed AbstractClient -> AbstractConnection 2019-04-29 20:52:40 +03:00
Calin Culianu
49b0e59b0a update ts on line read in TcpServer client stub 2019-04-28 15:03:48 +03:00
Calin Culianu
f6ac87c4b2 Refactored TcpServer's client to use AbstractClient
Yay.. code is more reusable now in general.  Was a good exercise.

Todo: refactor the JsonRPC stuff to be generic and reusable.
2019-04-28 14:59:01 +03:00
Calin Culianu
bc8144ea84 Refactorings continue...
TcpServer now uses the ThreadObjectMixin.. yay.

Plus misc other cleanup.

Now I can implement the client..
2019-04-28 11:59:14 +03:00
Calin Culianu
dd7fdcc9e0 Added IdMixin mixin 2019-04-28 11:06:50 +03:00
Calin Culianu
a0f51cf449 fixed compile errod on windows 2019-04-28 01:58:22 +03:00
Calin Culianu
2ba541f1ce added Client class beginnings.. for represending client connections from wallet 2019-04-27 22:43:09 +03:00
Calin Culianu
2477a7a8a3 Added initial TcpServer stub implementation
- Already supports listening on as many sockets as you wish
- Each listening server has its own thread
- Will implement later: SSL server

Also refactored code a bit, created the generic "Controller" class, made
EXMgr and SrvMgr inherit from it.

ToDo: Figure out workflow for connections and clients, model client
sessions, etc.
2019-04-26 08:47:46 +03:00