Add hasDataBuffered to asyncnet (#16000)
Co-authored-by: flywind <xzsflywind@gmail.com> Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
This commit is contained in:
parent
ed126794b6
commit
35655cd189
2 changed files with 7 additions and 0 deletions
|
|
@ -246,6 +246,8 @@
|
||||||
|
|
||||||
- Added dollar `$` and `len` for `jsre.RegExp`.
|
- Added dollar `$` and `len` for `jsre.RegExp`.
|
||||||
|
|
||||||
|
- Added `hasDataBuffered` to `asyncnet`.
|
||||||
|
|
||||||
- Added `hasClosure` to `std/typetraits`.
|
- Added `hasClosure` to `std/typetraits`.
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -650,6 +650,11 @@ proc bindAddr*(socket: AsyncSocket, port = Port(0), address = "") {.
|
||||||
raiseOSError(osLastError())
|
raiseOSError(osLastError())
|
||||||
freeaddrinfo(aiList)
|
freeaddrinfo(aiList)
|
||||||
|
|
||||||
|
proc hasDataBuffered*(s: AsyncSocket): bool {.since: (1, 5).} =
|
||||||
|
## Determines whether an AsyncSocket has data buffered.
|
||||||
|
# xxx dedup with std/net
|
||||||
|
s.isBuffered and s.bufLen > 0 and s.currPos != s.bufLen
|
||||||
|
|
||||||
when defined(posix):
|
when defined(posix):
|
||||||
|
|
||||||
proc connectUnix*(socket: AsyncSocket, path: string): owned(Future[void]) =
|
proc connectUnix*(socket: AsyncSocket, path: string): owned(Future[void]) =
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue