|
83 | 83 | 1. result, listen_socket = **tcp.listen**(addr, port[, reuse, [listen_callback(result, listen_socket, addr, port[, reuse])]]) |
84 | 84 | *`--listen on a ipv4 address.`* |
85 | 85 | *`--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!`* |
86 | 89 |
|
87 | 90 | 2. result, listen_socket = **tcp.listens**(sock_name[, listen_callback(result, listen_socket, sock_name)]) |
88 | 91 | *`--listen on a windows named pipe or unix domain socket.`* |
|
91 | 94 | 3. result, listen_socket = **tcp.listen6**(addr, port[, reuse, [listen_callback(result, listen_socket, addr, port[, reuse])]]) |
92 | 95 | *`--listen on a ipv6 address.`* |
93 | 96 | *`--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!`* |
94 | 100 |
|
95 | 101 | 4. result, accept_socket = **tcp.accept**(listen_socket[, timeout]) |
96 | 102 | *`--accept on a listen socket in blocking mode, timeout is activated if timeout is set.`* |
|
0 commit comments