From 7ba0fd0ce19244745c8d2512ce8a003783d914a7 Mon Sep 17 00:00:00 2001 From: dimitri staessens Date: Thu, 30 Mar 2017 20:33:22 +0200 Subject: lib: Revise flow allocation API The flow_alloc_res and flow_alloc_resp calls have been removed. The flow_alloc and flow_accept calls are now both blocking and take an additional timeout argument. --- src/tools/echo/echo_client.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'src/tools/echo/echo_client.c') diff --git a/src/tools/echo/echo_client.c b/src/tools/echo/echo_client.c index f84de73a..5ec2051f 100644 --- a/src/tools/echo/echo_client.c +++ b/src/tools/echo/echo_client.c @@ -26,25 +26,17 @@ int client_main(void) { int fd = 0; - int result = 0; char buf[BUF_SIZE]; char * message = "Client says hi!"; ssize_t count = 0; - fd = flow_alloc("echo", NULL); + fd = flow_alloc("echo", NULL, NULL); if (fd < 0) { printf("Failed to allocate flow.\n"); return -1; } - result = flow_alloc_res(fd); - if (result < 0) { - printf("Flow allocation refused.\n"); - flow_dealloc(fd); - return -1; - } - - if (flow_write(fd, message, strlen(message) + 1) == -1) { + if (flow_write(fd, message, strlen(message) + 1) < 0) { printf("Failed to write SDU.\n"); flow_dealloc(fd); return -1; -- cgit v1.2.3