summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/async/tasyncawait.nim13
1 files changed, 3 insertions, 10 deletions
diff --git a/tests/async/tasyncawait.nim b/tests/async/tasyncawait.nim
index 9e5d270c3..fea0783a0 100644
--- a/tests/async/tasyncawait.nim
+++ b/tests/async/tasyncawait.nim
@@ -15,24 +15,17 @@ const
 var clientCount = 0
 
 proc sendMessages(disp: PDispatcher, client: TSocketHandle): PFuture[int] {.async.} =
-  echo("entering sendMessages")
   for i in 0 .. <messagesToSend:
     discard await disp.send(client, "Message " & $i & "\c\L")
-  echo("returning sendMessages")
 
 proc launchSwarm(disp: PDispatcher, port: TPort): PFuture[int] {.async.} =
   for i in 0 .. <swarmSize:
-    var sock = socket()
-    # TODO: We may need to explicitly register and unregister the fd.
-    # This is because when the socket is closed, selectors is not aware
-    # that it has been closed. While epoll is. Perhaps we should just unregister
-    # in close()?
-    echo(sock.cint)
+    var sock = disp.socket()
+
     #disp.register(sock)
     discard await disp.connect(sock, "localhost", port)
     when true:
       discard await sendMessages(disp, sock)
-      echo("Calling close")
       sock.close()
     else:
       # Issue #932: https://github.com/Araq/Nimrod/issues/932
@@ -55,7 +48,7 @@ proc readMessages(disp: PDispatcher, client: TSocketHandle): PFuture[int] {.asyn
         doAssert false
 
 proc createServer(disp: PDispatcher, port: TPort): PFuture[int] {.async.} =
-  var server = socket()
+  var server = disp.socket()
   #disp.register(server)
   server.bindAddr(port)
   server.listen()