Commit graph

17 commits

Author SHA1 Message Date
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
Calin Culianu
d3cc2ff830 Tweaks
- Only send server.ping on idle >1min (previously we sent
unconditionally once a minute)

- Added __attrubute__ format stuff to the printf-like log functions

- Small nit
2019-04-24 12:44:01 +03:00
Calin Culianu
3721baf3bb Moved reqid generation from EXClient to EXMgr
This is probably where it belongs. Will allow us to track requests to the
ElectrumX server better as we implement more of this server.
2019-04-24 10:57:11 +03:00
Calin Culianu
92da67a602 tweak 2019-04-24 08:10:37 +03:00
Calin Culianu
1a06e27f94 Defense against malicious EX server. Disallow filling our buffers indef. 2019-04-24 08:07:47 +03:00
Calin Culianu
dca9c804b3 defensive programming tweak 2019-04-24 07:58:41 +03:00
Calin Culianu
2faacb2c6e Got SSL working by turning off verify certs. We use SSL now preferentially if available 2019-04-24 07:54:46 +03:00
Calin Culianu
1d44070d61 tweak to remember EXClient bad status beyond disconnect 2019-04-24 07:01:28 +03:00
Calin Culianu
68e5d9f7d0 Hardened socket code a bit for EXClient 2019-04-24 06:54:32 +03:00
Calin Culianu
027f0f1b44 renamed EXClient 'keepAliveTimer' -> 'pingTimer' 2019-04-23 23:55:07 +03:00
Calin Culianu
6b4d41ea98 tweak 2019-04-23 23:31:14 +03:00
Calin Culianu
0c51a34190 Fixups to fix crash
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.
2019-04-23 21:51:53 +03:00
Calin Culianu
3aec346c74 Tweak to prevent leaking idMethodMap if bad server 2019-04-23 19:20:48 +03:00
Calin Culianu
2db4d09705 implemented checkClients (maintain EXClients) 2019-04-23 18:49:36 +03:00
Calin Culianu
58461e7890 implemented 3 electrum x protocol commands. getting there. 2019-04-23 16:24:18 +03:00
Calin Culianu
4637012e22 Added more EXClient stuff 2019-04-23 12:36:51 +03:00
Calin Culianu
62101beeac Initial revision. Just laying out a skeleton to build on. 2019-04-23 02:33:16 +03:00