浏览代码

Fix mistake in modbus_tcp_listen documentation

Stéphane Raimbault 11 年之前
父节点
当前提交
900aa475d3
共有 1 个文件被更改,包括 6 次插入8 次删除
  1. 6 8
      doc/modbus_tcp_listen.txt

+ 6 - 8
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);