Commit Graph

64 Commits

Author SHA1 Message Date
Efim Poberezkin 8ab79b066d agent store: add update queue methods (#19) 2021-02-26 18:11:22 +04:00
Evgeny Poberezkin 10fb667ff3 Receive messages (#17)
* framework to parse and process agent messages

* update SMPClient functions to accept private key

* process messages (WIP)

* agent: create reply queue and send REPLY message with qInfo

* refactor agent commands

* refactor processSMPTransmission

* agent: logic to process REPLY message
2021-02-26 18:11:22 +04:00
Efim Poberezkin c1f15c9d93 tests: randomize db file name to fix io errors (#16)
* tests: check file doesn't exist in store tests after

* Revert "tests: check file doesn't exist in store tests after"

This reverts commit de624433a9.

* [WIP] tests: randomize db file

* [WIP] tests: try runIO to get filename into after

* random db file name for agent tests

* tests: randomize DB file name

* tests: increase SMP agent start delay

Co-authored-by: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com>
2021-02-26 18:11:22 +04:00
Evgeny Poberezkin 3efb15ecb3 receiving messages and remaining client functions (#15)
* SMPClient queues for messages and notifications

* style

* SMPClient: put all messages (and uncorrelated server commands) to provided TBQueue
2021-02-26 18:11:22 +04:00
Efim Poberezkin 5f59fcc969 agent store: add createMsg (#14) 2021-01-15 19:30:11 +04:00
Evgeny Poberezkin 2e6ba85308 SMP client library (#9)
* functions to send SMP commands and receive responses

* refactor agent: use SMPClient

* fix tests, remove ServerClient.hs

* refactor processCommand

* fix Agent.hs

* fix SMPClient, tests

* "forever" to SMPClient process
2021-02-26 18:09:26 +04:00
Evgeny Poberezkin 02a15f9f25 agent tests (#8) 2021-02-26 18:09:26 +04:00
Evgeny Poberezkin 253f4e39c9 JOIN command (#4)
* parse JOIN command

* parse JOIN command

* serialize NEW command

* parse and serialize CON response

* process JOIN command: SEND confirmation (WIP)

* process response to the confirmation from JOIN command

* remove comment
2021-01-11 18:31:10 +00:00
Efim Poberezkin 7f22dcd496 agent store: add updateQueueStatus tests 2021-01-11 19:34:30 +04:00
Efim Poberezkin f5aaab3861 agent store: fix updateQueueStatus 2021-01-10 23:43:57 +04:00
Efim Poberezkin b9cdc6a09d agent store: add updateQueueStatus; TODO finalize, tests 2021-01-10 16:08:19 +04:00
Evgeny Poberezkin ef028c135d agent SQLiteStore: method stubs 2021-01-09 20:54:41 +00:00
Evgeny Poberezkin 394803b3cf remove/fix compiler warnings 2021-01-09 20:48:07 +00:00
Evgeny Poberezkin d1c5e9df7b agent: ErrorType constructor for store errors, exceptions are caught 2021-01-09 19:55:42 +00:00
Evgeny Poberezkin 3dbdb948ae agent: respond with INV (TODO: store exception blows up; select does not work without port 2021-01-09 19:23:32 +00:00
Evgeny Poberezkin a1c4ce6448 refactor store: simplify 2021-01-09 13:04:13 +00:00
Evgeny Poberezkin 0d0a12f778 refactor store: m (Either e a) => ExceptT e m a 2021-01-09 11:18:52 +00:00
Evgeny Poberezkin 75f58f8ba4 remove unnecessary bindings 2021-01-09 08:31:21 +00:00
Efim Poberezkin af5bd101cb agent store: make create connection methods return () 2021-01-08 15:51:33 +04:00
Efim Poberezkin 19238c6cc4 agent store: add deleteConn and tests 2021-01-07 17:58:46 +04:00
Efim Poberezkin e692cb0119 add addRcvQueue and tests 2021-01-07 14:00:53 +04:00
Evgeny Poberezkin 51cc602bdb agent store: refactor addSndQueue 2021-01-06 20:22:00 +00:00
Efim Poberezkin 5a6b1c67a9 add test testAddSndQueue 2021-01-06 23:01:53 +04:00
Efim Poberezkin 94d0be5d27 add test for addSndQueue 2021-01-06 22:35:04 +04:00
Efim Poberezkin 61092e8371 add implemented addSndQueue 2021-01-06 22:11:55 +04:00
Efim Poberezkin 1c32fccb39 [WIP] add addSndQueue 2021-01-06 18:03:55 +04:00
Evgeny Poberezkin 6e6ad0fb9b agent store: getConn with tests 2021-01-05 20:31:01 +00:00
Evgeny Poberezkin a555c4e510 agent store: getSndQueue 2021-01-05 19:42:50 +00:00
Evgeny Poberezkin 4a19602be6 agent store: getRcvQueue 2021-01-05 19:34:47 +00:00
Efim Poberezkin a28462d496 add select functions drafts 2021-01-05 19:44:44 +04:00
Evgeny Poberezkin 5d2e77f41d test: agent SQLite createRcvConnection 2021-01-04 20:25:02 +00:00
Efim Poberezkin 2e761b20f6 remove commented queries 2021-01-04 18:01:11 +04:00
Efim Poberezkin 9a1ffb349a add insertSndQueue, insertSndConnection and implementation of createSndConn 2021-01-04 17:48:29 +04:00
Evgeny Poberezkin 15cf2e9fff upsertServer: use select to get server ID 2021-01-04 10:39:20 +00:00
Evgeny Poberezkin 650971fa02 method to insert connection (#3) 2021-01-03 18:05:50 +00:00
Evgeny Poberezkin 3d4f43a051 add NOT NULL constraints 2021-01-03 12:47:12 +00:00
Evgeny Poberezkin 6526e421e8 insertWithLock 2021-01-03 11:44:07 +00:00
Evgeny Poberezkin 48967167c4 add table mutexes for insert queries (to get inserted ID thread-safely via single connection) 2021-01-03 11:31:06 +00:00
Evgeny Poberezkin d260a464d6 add error handling, function to process SMP responses 2021-01-03 10:42:41 +00:00
Efim Poberezkin 3c1834f93f implement addServer command 2020-12-30 18:54:17 +04:00
Evgeny Poberezkin 44b58a5bf0 fix: agent communicates with local SMP server 2020-12-29 21:21:51 +00:00
Evgeny Poberezkin cdf8695bef send NEW command to SMP server (response is not received for some reason...) 2020-12-29 20:51:09 +00:00
Efim Poberezkin d6e1aeacdf write null sender queue on initial connection insert 2020-12-29 22:19:20 +04:00
Efim Poberezkin 92d170f178 add queries drafts for insertion of server, queue, connection 2020-12-29 21:30:00 +04:00
Evgeny Poberezkin 9d15035fb3 client/agent transmission types, parse NEW/INV commands 2020-12-29 13:11:46 +00:00
Evgeny Poberezkin dabef7f0d1 use quasiqoutes for queries 2020-12-28 21:23:28 +00:00
Evgeny Poberezkin cf38b4dddf agent: Transmission type 2020-12-28 20:42:47 +00:00
Efim Poberezkin c47f583574 add unique constraints todo 2020-12-28 23:50:04 +04:00
Efim Poberezkin dea5c6478a change fields to blobs 2020-12-28 23:32:05 +04:00
Efim Poberezkin 205c6bf117 add servers table to database 2020-12-28 22:06:01 +04:00