From 810dde21ee65653c15606917b19566cfbaaf165e Mon Sep 17 00:00:00 2001 From: Uros Majstorovic Date: Tue, 9 Aug 2022 21:54:45 +0200 Subject: ecp server added --- ecp/test/client.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'ecp/test/client.c') diff --git a/ecp/test/client.c b/ecp/test/client.c index d526f76..52a8587 100644 --- a/ecp/test/client.c +++ b/ecp/test/client.c @@ -3,10 +3,12 @@ #include #include -#include +#include #include +#include "init.h" + ECPContext ctx; ECPSocket sock; ECPConnHandler handler; @@ -48,7 +50,7 @@ int main(int argc, char *argv[]) { printf("ecp_init RV:%d\n", rv); ecp_conn_handler_init(&handler, handle_msg, handle_open, NULL, NULL); - ecp_ctx_set_handler(&ctx, &handler, CTYPE_TEST); + ecp_ctx_set_handler(&ctx, CTYPE_TEST, &handler); rv = ecp_dhkey_gen(&key_perma); printf("ecp_dhkey_gen RV:%d\n", rv); @@ -62,15 +64,14 @@ int main(int argc, char *argv[]) { rv = ecp_start_receiver(&sock); printf("ecp_start_receiver RV:%d\n", rv); - rv = ecp_conn_create(&conn, &sock, CTYPE_TEST); - printf("ecp_conn_create RV:%d\n", rv); - rv = ecp_util_load_pub(&node_pub, argv[2]); printf("ecp_util_load_pub RV:%d\n", rv); - rv = ecp_node_init(&node, &node_pub, argv[1]); - printf("ecp_node_init RV:%d\n", rv); + ecp_node_init(&node, &node_pub, NULL); + rv = ecp_node_set_addr(&node, argv[1]); + printf("ecp_node_set_addr RV:%d\n", rv); + ecp_conn_init(&conn, &sock, CTYPE_TEST); rv = ecp_conn_open(&conn, &node); printf("ecp_conn_open RV:%d\n", rv); -- cgit v1.2.3