summary refs log tree commit diff stats
path: root/tests/async/tmultisync.nim
blob: 9ef9b105c93d9d435d4c7069e40ec10e527ab3ac (plain) (blame)
1
2
3
4
5
6
7
8
import asyncdispatch, net, asyncnet

proc recvTwice(socket: Socket | AsyncSocket,
               size: int): Future[string] {.multisync.} =
  var x = await socket.recv(size)
  var y = await socket.recv(size+1)
  return x & "aboo" & y