From 14832c4ffec02b47d953a1c6d70576070ce74935 Mon Sep 17 00:00:00 2001 From: Determinant Date: Tue, 4 Jun 2019 23:15:03 -0400 Subject: the minimal example works --- test/.gitignore | 1 + test/test_msgnet_c.c | 4 ++++ 2 files changed, 5 insertions(+) (limited to 'test') 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); -- cgit v1.2.3-70-g09d2