Skip to content

Commit a925fde

Browse files
committed
提供tcp.listen reuse参数解释。
1 parent 2fa0ee2 commit a925fde

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@ Contact with **Email: [email protected]** or **QQ: 443231647**
8383
1. result, listen_socket = **tcp.listen**(addr, port[, reuse, [listen_callback(result, listen_socket, addr, port[, reuse])]])
8484
*`--listen on a ipv4 address.`*
8585
*`--listen_callback is a once callback, blocking if listen_callback is nil.`*
86+
*`--reuse option allows you to listen on the same specified port.`*
87+
*`--If you are listening on the same port among several sockets at unix system, you will accept the connecting socket in round-robin sequence among all the listening sockets.`*
88+
*`--If you are listening on the same port among several sockets at windows system, you will most likely accept the connecting socket at the first listening socket!`*
8689

8790
2. result, listen_socket = **tcp.listens**(sock_name[, listen_callback(result, listen_socket, sock_name)])
8891
*`--listen on a windows named pipe or unix domain socket.`*
@@ -91,6 +94,9 @@ Contact with **Email: [email protected]** or **QQ: 443231647**
9194
3. result, listen_socket = **tcp.listen6**(addr, port[, reuse, [listen_callback(result, listen_socket, addr, port[, reuse])]])
9295
*`--listen on a ipv6 address.`*
9396
*`--listen_callback is a once callback, blocking if listen_callback is nil.`*
97+
*`--reuse option allows you to listen on the same specified port.`*
98+
*`--If you are listening on the same port among several sockets at unix system, you will accept the connecting socket in round-robin sequence among all the listening sockets.`*
99+
*`--If you are listening on the same port among several sockets at windows system, you will most likely accept the connecting socket at the first listening socket!`*
94100

95101
4. result, accept_socket = **tcp.accept**(listen_socket[, timeout])
96102
*`--accept on a listen socket in blocking mode, timeout is activated if timeout is set.`*

0 commit comments

Comments
 (0)