summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorDominik Picheta <dominikpicheta@googlemail.com>2013-06-21 16:07:13 +0200
committerDominik Picheta <dominikpicheta@googlemail.com>2013-06-21 16:07:13 +0200
commita1e823b03856c9f0d0b2a713e70f651ea9ad1fea (patch)
tree21c99555e840f87a3938df2a36ee8a91ccce4bea
parentff1d68c50b5df56645eb09a523c08726772bec4d (diff)
downloadNim-a1e823b03856c9f0d0b2a713e70f651ea9ad1fea.tar.gz
Added an asyncio.isSendDataBuffered procedure.
-rw-r--r--lib/pure/asyncio.nim4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/pure/asyncio.nim b/lib/pure/asyncio.nim
index 403401ff1..a1ce75af3 100644
--- a/lib/pure/asyncio.nim
+++ b/lib/pure/asyncio.nim
@@ -423,6 +423,10 @@ proc isConnecting*(s: PAsyncSocket): bool =
 proc isClosed*(s: PAsyncSocket): bool =
   ## Determines whether ``s`` has been closed.
   return s.info == SockClosed
+proc isSendDataBuffered*(s: PAsyncSocket): bool =
+  ## Determines whether ``s`` has data waiting to be sent, i.e. whether this
+  ## socket's sendBuffer contains data. 
+  return s.sendBuffer.len != 0
 
 proc setHandleWrite*(s: PAsyncSocket,
     handleWrite: proc (s: PAsyncSocket) {.closure.}) =