Consts
asyncInvalidPipe = -1'i32
- Source Edit
asyncInvalidSocket = -1'i32
- Source Edit
Procs
proc createAsyncPipe(): tuple[read: AsyncFD, write: AsyncFD] {....raises: [], tags: [].}
- Create new asynchronouse pipe. Returns tuple of read pipe handle and write pipe handleasyncInvalidPipe on error. Source Edit
proc createAsyncSocket(domain: Domain; sockType: SockType; protocol: Protocol; inherit = true): AsyncFD {....raises: [], tags: [].}
- Creates new asynchronous socket. Returns asyncInvalidSocket on error. Source Edit
proc createAsyncSocket2(domain: Domain; sockType: SockType; protocol: Protocol; inherit = true): Result[AsyncFD, OSErrorCode] {. ...raises: [], tags: [].}
- Creates new asynchronous socket. Source Edit
proc getDualstack(fd: AsyncFD): Result[bool, OSErrorCode] {....raises: [], tags: [].}
- Returns true if IPV6_V6ONLY socket option set to false. Source Edit
proc getInheritable(fd: AsyncFD): Result[bool, OSErrorCode] {....raises: [], tags: [].}
- Returns true if fd is inheritable handle. Source Edit
proc getMaxOpenFiles(): int {....raises: [OSError], raises: [], tags: [].}
-
Returns maximum file descriptor number that can be opened by this process.
Note: On Windows its impossible to obtain such number, so getMaxOpenFiles() will return constant value of 16384. You can get more information on this link https://docs.microsoft.com/en-us/archive/blogs/markrussinovich/pushing-the-limits-of-windows-handles
Source Edit proc getMaxOpenFiles2(): Result[int, OSErrorCode] {....raises: [], tags: [].}
-
Returns maximum file descriptor number that can be opened by this process.
Note: On Windows its impossible to obtain such number, so getMaxOpenFiles() will return constant value of 16384. You can get more information on this link https://docs.microsoft.com/en-us/archive/blogs/markrussinovich/pushing-the-limits-of-windows-handles
Source Edit proc getSocketError(socket: AsyncFD; err: var int): bool {. ...deprecated: "Please use getSocketError() instead", raises: [], tags: [].}
- socket. Source Edit Recover error code associated with socket handle
proc getSocketError2(socket: AsyncFD): Result[cint, OSErrorCode] {....raises: [], tags: [].}
- Source Edit
proc getSockOpt(socket: AsyncFD; level, optname: int; value: var int): bool {. ...deprecated: "Please use getSockOpt2() instead", raises: [], tags: [].}
- getsockopt() for integer options. Returns true on success, false on error. Source Edit
proc getSockOpt(socket: AsyncFD; level, optname: int; value: var pointer; valuelen: var int): bool {. ...deprecated: "Please use getSockOpt2() instead", raises: [], tags: [].}
- getsockopt() for custom options (pointer and length). Returns true on success, false on error. Source Edit
proc getSockOpt2(socket: AsyncFD; level, optname: int): Result[cint, OSErrorCode] {. ...raises: [], tags: [].}
- Source Edit
proc getSockOpt2(socket: AsyncFD; level, optname: int; T: type): Result[T, OSErrorCode] {....raises: [].}
- Source Edit
proc isAvailable(domain: Domain): bool {....raises: [], tags: [].}
- Source Edit
proc setDualstack(fd: AsyncFD; value: bool): Result[void, OSErrorCode] {. ...raises: [], tags: [].}
- Sets IPV6_V6ONLY socket option value to false if value == true and to true if value == false. Source Edit
proc setMaxOpenFiles(count: int) {....raises: [OSError], raises: [], tags: [].}
-
Set maximum file descriptor number that can be opened by this process.
Note: On Windows its impossible to set this value, so it just a nop call.
Source Edit proc setMaxOpenFiles2(count: int): Result[void, OSErrorCode] {....raises: [], tags: [].}
-
Set maximum file descriptor number that can be opened by this process.
Note: On Windows its impossible to set this value, so it just a nop call.
Source Edit proc setSocketBlocking(s: SocketHandle; blocking: bool): bool {. ...deprecated: "Please use setDescriptorBlocking() instead", raises: [], tags: [].}
- Source Edit Sets blocking mode on socket.
proc setSockOpt(socket: AsyncFD; level, optname, optval: int): bool {. ...deprecated: "Please use setSockOpt2() instead", raises: [], tags: [].}
- setsockopt() for integer options. Returns true on success, false on error. Source Edit
proc setSockOpt(socket: AsyncFD; level, optname: int; value: pointer; valuelen: int): bool {....deprecated: "Please use setSockOpt2() instead", raises: [], tags: [].}
- setsockopt() for custom options (pointer and length). Returns true on success, false on error. Source Edit
proc setSockOpt2(socket: AsyncFD; level, optname, optval: int): Result[void, OSErrorCode] {....raises: [], tags: [].}
- Source Edit
proc setSockOpt2(socket: AsyncFD; level, optname: int; value: pointer; valuelen: int): Result[void, OSErrorCode] {....raises: [], tags: [].}
- setsockopt() for custom options (pointer and length). Returns true on success, false on error. Source Edit
proc wrapAsyncSocket(sock: cint | SocketHandle): AsyncFD {. ...raises: [CatchableError], raises: [].}
- Wraps socket to asynchronous socket handle. Return asyncInvalidSocket on error. Source Edit
proc wrapAsyncSocket2(sock: cint | SocketHandle): Result[AsyncFD, OSErrorCode] {. ...raises: [].}
- Wraps socket to asynchronous socket handle. Source Edit