Changeset View
Changeset View
Standalone View
Standalone View
files/0003-fix-tasyncsend4757-test.patch
- This file was added.
| diff -Nru nim-0.17.2.orig/tests/async/tasyncsend4757.nim nim-0.17.2/tests/async/tasyncsend4757.nim | |||||
| --- nim-0.17.2.orig/tests/async/tasyncsend4757.nim 2017-09-07 21:45:44.000000000 +0300 | |||||
| +++ nim-0.17.2/tests/async/tasyncsend4757.nim 2017-11-06 22:31:36.859257572 +0300 | |||||
| @@ -3,11 +3,22 @@ | |||||
| output: "Finished" | |||||
| """ | |||||
| -import asyncdispatch | |||||
| +import asyncdispatch, asyncnet | |||||
| + | |||||
| +proc createServer(port: Port) {.async.} = | |||||
| + var server = newAsyncSocket() | |||||
| + server.setSockOpt(OptReuseAddr, true) | |||||
| + bindAddr(server, port) | |||||
| + server.listen() | |||||
| + while true: | |||||
| + let client = await server.accept() | |||||
| + discard await client.recvLine() | |||||
| + | |||||
| +asyncCheck createServer(10335.Port) | |||||
| proc f(): Future[void] {.async.} = | |||||
| let s = newAsyncNativeSocket() | |||||
| - await s.connect("example.com", 80.Port) | |||||
| + await s.connect("localhost", 10335.Port) | |||||
| await s.send("123") | |||||
| echo "Finished" | |||||
Copyright © 2015-2021 Solus Project. The Solus logo is Copyright © 2016-2021 Solus Project. All Rights Reserved.