diff options
author | Anatoly Galiulin <galiulin.anatoly@gmail.com> | 2016-09-06 09:29:41 +0700 |
---|---|---|
committer | Anatoly Galiulin <galiulin.anatoly@gmail.com> | 2016-09-06 09:31:13 +0700 |
commit | 60dbfb2ec90d8ad080ae1b202fcc086cb2cf911c (patch) | |
tree | 3b38f806e3fcced5e30839e47daa01ca0a0dca3b /lib/upcoming | |
parent | 862d6ad2346b08fef0e28fbcf289edcad5461af4 (diff) | |
download | Nim-60dbfb2ec90d8ad080ae1b202fcc086cb2cf911c.tar.gz |
Revert function names scheme due to the @dom96 comment
Diffstat (limited to 'lib/upcoming')
-rw-r--r-- | lib/upcoming/asyncdispatch.nim | 24 |
1 files changed, 6 insertions, 18 deletions
diff --git a/lib/upcoming/asyncdispatch.nim b/lib/upcoming/asyncdispatch.nim index 96392c417..dc7a72a48 100644 --- a/lib/upcoming/asyncdispatch.nim +++ b/lib/upcoming/asyncdispatch.nim @@ -718,7 +718,7 @@ when defined(windows) or defined(nimdoc): retFuture.complete("") return retFuture - proc recvBuffer*(socket: AsyncFD, buf: pointer, size: int, + proc recvInto*(socket: AsyncFD, buf: pointer, size: int, flags = {SocketFlag.SafeDisconn}): Future[int] = ## Reads **up to** ``size`` bytes from ``socket`` into ``buf``, which must ## at least be of that size. Returned future will complete once all the @@ -738,7 +738,7 @@ when defined(windows) or defined(nimdoc): verifyPresence(socket) assert SocketFlag.Peek notin flags, "Peek not supported on Windows." - var retFuture = newFuture[int]("recvBuffer") + var retFuture = newFuture[int]("recvInto") #buf[] = '\0' var dataBuf: TWSABuf @@ -785,19 +785,7 @@ when defined(windows) or defined(nimdoc): retFuture.complete(bytesReceived) return retFuture - proc recvInto*(socket: AsyncFD, buf: cstring, size: int, - flags = {SocketFlag.SafeDisconn}): Future[int] = - ## Reads **up to** ``size`` bytes from ``socket`` into ``buf``, which must - ## at least be of that size. Returned future will complete once all the - ## data requested is read, a part of the data has been read, or the socket - ## has disconnected in which case the future will complete with a value of - ## ``0``. - ## - ## **Warning**: The ``Peek`` socket flag is not supported on Windows. - - socket.recvBuffer(buf, size, flags) - - proc sendBuffer*(socket: AsyncFD, buf: pointer, size: int, + proc send*(socket: AsyncFD, buf: pointer, size: int, flags = {SocketFlag.SafeDisconn}): Future[void] = ## Sends ``size`` bytes from ``buf`` to ``socket``. The returned future will complete once all ## data has been sent. @@ -1582,9 +1570,9 @@ else: addRead(socket, cb) return retFuture - proc recvBuffer*(socket: AsyncFD, buf: pointer, size: int, + proc recvInto*(socket: AsyncFD, buf: pointer, size: int, flags = {SocketFlag.SafeDisconn}): Future[int] = - var retFuture = newFuture[int]("recvBuffer") + var retFuture = newFuture[int]("recvInto") proc cb(sock: AsyncFD): bool = result = true @@ -1606,7 +1594,7 @@ else: addRead(socket, cb) return retFuture - proc sendBuffer*(socket: AsyncFD, buf: pointer, size: int, + proc send*(socket: AsyncFD, buf: pointer, size: int, flags = {SocketFlag.SafeDisconn}): Future[void] = var retFuture = newFuture[void]("send") |