From 900aa475d31abd9db45e4fb4ce0421c837e04c71 Mon Sep 17 00:00:00 2001 From: Stéphane Raimbault Date: Wed, 9 Oct 2013 10:11:30 +0200 Subject: [PATCH] Fix mistake in modbus_tcp_listen documentation --- doc/modbus_tcp_listen.txt | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/doc/modbus_tcp_listen.txt b/doc/modbus_tcp_listen.txt index f15f593..df65d46 100644 --- a/doc/modbus_tcp_listen.txt +++ b/doc/modbus_tcp_listen.txt @@ -4,7 +4,7 @@ modbus_tcp_listen(3) NAME ---- -modbus_tcp_listen - create and listen a TCP Modbus socket +modbus_tcp_listen - create and listen a TCP Modbus socket (IPv4) SYNOPSIS @@ -26,19 +26,17 @@ successful. Otherwise it shall return -1 and set errno. EXAMPLE ------- -For a detailed example, see source file bandwith-server-many-up.c provided in -tests directory. +For detailed examples, see source files in tests directory: + +- unit-test-server.c, simple but handle only one connection +- bandwith-server-many-up.c, handles several connections at once + [source,c] ------------------- ... ctx = modbus_new_tcp("127.0.0.1", 502); -if (modbus_connect(ctx) == -1) { - fprintf(stderr, "Connection failed: %s\n", modbus_strerror(errno)); - modbus_free(ctx); - return -1; -} /* Handle until 10 established connections */ server_socket = modbus_tcp_listen(ctx, 10); -- libgit2 0.21.4