aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDeterminant <[email protected]>2019-06-04 23:15:03 -0400
committerDeterminant <[email protected]>2019-06-04 23:15:03 -0400
commit14832c4ffec02b47d953a1c6d70576070ce74935 (patch)
tree03abdbb981f35dab2f91d5244e5e71990ccb837c
parentfad6446ce15bcd1303fdd162d6938ab30046467e (diff)
the minimal example works
-rw-r--r--test/.gitignore1
-rw-r--r--test/test_msgnet_c.c4
2 files changed, 5 insertions, 0 deletions
diff --git a/test/.gitignore b/test/.gitignore
index 57a2e9b..bbd91a2 100644
--- a/test/.gitignore
+++ b/test/.gitignore
@@ -6,3 +6,4 @@ test_p2p_stress
test_queue
bench_network
Makefile
+test_msgnet_c
diff --git a/test/test_msgnet_c.c b/test/test_msgnet_c.c
index b717c3a..b09e375 100644
--- a/test/test_msgnet_c.c
+++ b/test/test_msgnet_c.c
@@ -132,6 +132,7 @@ MyNet gen_mynet(const eventcontext_t *ec,
res.net = msgnetwork_new(ec, netconfig);
msgnetwork_config_free(netconfig);
res.name = name;
+ return res;
};
static eventcontext_t *ec;
@@ -154,6 +155,9 @@ int main() {
msgnetwork_reg_handler(bob.net, MSG_OPCODE_HELLO, on_receive_hello);
msgnetwork_reg_handler(bob.net, MSG_OPCODE_ACK, on_receive_ack);
+ msgnetwork_reg_conn_handler(alice.net, conn_handler);
+ msgnetwork_reg_conn_handler(bob.net, conn_handler);
+
/* start all threads */
msgnetwork_start(alice.net);
msgnetwork_start(bob.net);