summaryrefslogtreecommitdiff
path: root/ecp/test/client.c
diff options
context:
space:
mode:
authorUros Majstorovic <majstor@majstor.org>2022-08-09 21:54:45 +0200
committerUros Majstorovic <majstor@majstor.org>2022-08-09 21:54:45 +0200
commit810dde21ee65653c15606917b19566cfbaaf165e (patch)
tree4cd84b109e06660a9c59f2487822905e5672681e /ecp/test/client.c
parentaee853a208d6abec53ec81dc4ef110b63e13342f (diff)
ecp server added
Diffstat (limited to 'ecp/test/client.c')
-rw-r--r--ecp/test/client.c15
1 files changed, 8 insertions, 7 deletions
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 <unistd.h>
#include <stdio.h>
-#include <core.h>
+#include <ecp/core.h>
#include <util.h>
+#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);