tmultisync.nim 235 B

123456789
  1. import asyncdispatch, net, asyncnet
  2. proc recvTwice(socket: Socket | AsyncSocket,
  3. size: int): Future[string] {.multisync.} =
  4. var x = await socket.recv(size)
  5. var y = await socket.recv(size+1)
  6. return x & "aboo" & y