tasyncsend4757.nim 252 B

123456789101112131415
  1. discard """
  2. file: "tasyncsend4754.nim"
  3. output: "Finished"
  4. """
  5. import asyncdispatch
  6. proc f(): Future[void] {.async.} =
  7. let s = newAsyncNativeSocket()
  8. await s.connect("example.com", 80.Port)
  9. await s.send("123")
  10. echo "Finished"
  11. waitFor f()