summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorFederico Ceratto <federico.ceratto@gmail.com>2017-01-02 17:02:20 +0000
committerGitHub <noreply@github.com>2017-01-02 17:02:20 +0000
commita8c439afb581fc06a0dd77d27efbf9ff3a6cfb81 (patch)
tree6fd181bef980f63c863d91c763c477fbb51971d7 /lib
parentbf8f00f717467849ef16ed7829feff9f62780123 (diff)
downloadNim-a8c439afb581fc06a0dd77d27efbf9ff3a6cfb81.tar.gz
Add OptReuseAddr to example and handle closing
Diffstat (limited to 'lib')
-rw-r--r--lib/pure/asyncnet.nim2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/pure/asyncnet.nim b/lib/pure/asyncnet.nim
index 3b64c278f..5ad3b5263 100644
--- a/lib/pure/asyncnet.nim
+++ b/lib/pure/asyncnet.nim
@@ -36,12 +36,14 @@
 ##   proc processClient(client: AsyncSocket) {.async.} =
 ##     while true:
 ##       let line = await client.recvLine()
+##       if line.len == 0: break
 ##       for c in clients:
 ##         await c.send(line & "\c\L")
 ##
 ##   proc serve() {.async.} =
 ##     clients = @[]
 ##     var server = newAsyncSocket()
+##     server.setSockOpt(OptReuseAddr, true)
 ##     server.bindAddr(Port(12345))
 ##     server.listen()
 ##