不过我还是建议你用 {.async.} , 省不少事情,性能其实损失不了多少:
import asyncnet, asyncdispatch
proc recvAll(sock: AsyncSocket) {.async.} =
for i in 0 .. 50:
var ret = await recv(sock, 10)
echo("Read ", ret.len, ": ", ret.repr)
proc main() {.async.} =
var sock = newAsyncSocket()
await sock.connect("irc.freenode.net", Port(6667))
await sock.recvAll()
waitFor main()
- Favorable Rakhi for Bhaiya and Bhabhi on Rakhi Celebration anjalietrade
- Can't build asyncnet example on macosx Angluca
- Re: Can't build asyncnet example on macosx OderWat
- Re: Can't build asyncnet example on macosx _tulayang
- Re: Can't build asyncnet example on macosx Angluca
- Re: Can't build asyncnet example on mac... _tulayang
- Re: Can't build asyncnet example on... _tulayang
- Re: Can't build asyncnet exampl... Angluca
- Re: Can't build asyncnet exampl... OderWat
- Re: Can't build asyncnet exampl... Angluca
- Re: Can't build asyncnet exampl... dom96
- Re: Can't build asyncnet exampl... _tulayang
- Re: Can't build asyncnet exampl... qqtop
