diff --git a/lib/pure/asyncio.nim b/lib/pure/asyncio.nim index 403401ff1c..a1ce75af31 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.}) =