Fixes asyncnet example.
This commit is contained in:
parent
867dfbfbfa
commit
83e26cc4fa
1 changed files with 2 additions and 1 deletions
|
|
@ -31,7 +31,7 @@
|
||||||
##
|
##
|
||||||
## import asyncnet, asyncdispatch
|
## import asyncnet, asyncdispatch
|
||||||
##
|
##
|
||||||
## var clients: seq[AsyncSocket] = @[]
|
## var clients {.threadvar.}: seq[AsyncSocket]
|
||||||
##
|
##
|
||||||
## proc processClient(client: AsyncSocket) {.async.} =
|
## proc processClient(client: AsyncSocket) {.async.} =
|
||||||
## while true:
|
## while true:
|
||||||
|
|
@ -40,6 +40,7 @@
|
||||||
## await c.send(line & "\c\L")
|
## await c.send(line & "\c\L")
|
||||||
##
|
##
|
||||||
## proc serve() {.async.} =
|
## proc serve() {.async.} =
|
||||||
|
## clients = @[]
|
||||||
## var server = newAsyncSocket()
|
## var server = newAsyncSocket()
|
||||||
## server.bindAddr(Port(12345))
|
## server.bindAddr(Port(12345))
|
||||||
## server.listen()
|
## server.listen()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue