Module
Module documentation.
modulenet.poll
Classes
Classes and inheritance.
classnet.poll::Poller
@brief`Poller` type.
@details`Poller` encapsulates state and operations exported by the system module. It commonly stores runtime handles, protocol state, buffers, configuration, or collection data. Its methods define the primary behavior for the type. If the type owns external resources, prefer `dispose` or `close` for deterministic release.
class Poller {
/*
@brief `h` field.Functions
Free functions and class methods.
functionnet.poll::__poller_new
Signature
extern func __poller_new() -> Int;extern func __poller_new() -> Int;
/*
@brief Binds the low-level runtime symbol `__poller_bind_gc`.@briefBinds the low-level runtime symbol `__poller_new`.
@detailsThis function is an external entry point used by system modules to access native runtime capabilities such as filesystem, networking, threading, GC, cryptography, or platform operations. Prefer the safe wrapper functions in the same file when available. When calling this entry directly, pass validated arguments that match the signature and handle failures according to the return-value convention.
@returnReturns the operation result as `Int`.
functionnet.poll::__poller_bind_gc
Signature
extern func __poller_bind_gc(obj: Any) -> Void;extern func __poller_bind_gc(obj: Any) -> Void;
/*
@brief Binds the low-level runtime symbol `__gc_clear_memory_finalizer`.@briefBinds the low-level runtime symbol `__poller_bind_gc`.
@detailsThis function is an external entry point used by system modules to access native runtime capabilities such as filesystem, networking, threading, GC, cryptography, or platform operations. Prefer the safe wrapper functions in the same file when available. When calling this entry directly, pass validated arguments that match the signature and handle failures according to the return-value convention.
@param
- objObject instance or encoded object value inspected, converted, or serialized by the operation.
@returnVoid
functionnet.poll::__gc_clear_memory_finalizer
Signature
extern func __gc_clear_memory_finalizer(obj: Any) -> Void;extern func __gc_clear_memory_finalizer(obj: Any) -> Void;
/*
@brief Binds the low-level runtime symbol `__poller_free`.@briefBinds the low-level runtime symbol `__gc_clear_memory_finalizer`.
@detailsThis function is an external entry point used by system modules to access native runtime capabilities such as filesystem, networking, threading, GC, cryptography, or platform operations. Prefer the safe wrapper functions in the same file when available. When calling this entry directly, pass validated arguments that match the signature and handle failures according to the return-value convention.
@param
- objObject instance or encoded object value inspected, converted, or serialized by the operation.
@returnVoid
functionnet.poll::__poller_free
Signature
extern func __poller_free(h: Int) -> Void;extern func __poller_free(h: Int) -> Void;
/*
@brief Binds the low-level runtime symbol `__poller_add`.@briefBinds the low-level runtime symbol `__poller_free`.
@detailsThis function is an external entry point used by system modules to access native runtime capabilities such as filesystem, networking, threading, GC, cryptography, or platform operations. Prefer the safe wrapper functions in the same file when available. When calling this entry directly, pass validated arguments that match the signature and handle failures according to the return-value convention.
@param
- hUnderlying runtime handle.
@returnVoid
functionnet.poll::__poller_add
Signature
extern func __poller_add(h: Int, fd: Int, events: Int) -> Int;extern func __poller_add(h: Int, fd: Int, events: Int) -> Int;
/*
@brief Binds the low-level runtime symbol `__poller_del`.@briefBinds the low-level runtime symbol `__poller_add`.
@detailsThis function is an external entry point used by system modules to access native runtime capabilities such as filesystem, networking, threading, GC, cryptography, or platform operations. Prefer the safe wrapper functions in the same file when available. When calling this entry directly, pass validated arguments that match the signature and handle failures according to the return-value convention.
@param
- hUnderlying runtime handle.
- fdOperating-system file descriptor or socket descriptor.
- eventsEvent mask or event collection observed by the polling operation.
@returnReturns the operation result as `Int`.
functionnet.poll::__poller_del
Signature
extern func __poller_del(h: Int, fd: Int) -> Int;extern func __poller_del(h: Int, fd: Int) -> Int;
/*
@brief Binds the low-level runtime symbol `__poller_add_file`.@briefBinds the low-level runtime symbol `__poller_del`.
@detailsThis function is an external entry point used by system modules to access native runtime capabilities such as filesystem, networking, threading, GC, cryptography, or platform operations. Prefer the safe wrapper functions in the same file when available. When calling this entry directly, pass validated arguments that match the signature and handle failures according to the return-value convention.
@param
- hUnderlying runtime handle.
- fdOperating-system file descriptor or socket descriptor.
@returnReturns the operation result as `Int`.
functionnet.poll::__poller_add_file
Signature
extern func __poller_add_file(h: Int, file_handle: Int, events: Int) -> Int;extern func __poller_add_file(h: Int, file_handle: Int, events: Int) -> Int;
/*
@brief Binds the low-level runtime symbol `__poller_del_file`.@briefBinds the low-level runtime symbol `__poller_add_file`.
@detailsThis function is an external entry point used by system modules to access native runtime capabilities such as filesystem, networking, threading, GC, cryptography, or platform operations. Prefer the safe wrapper functions in the same file when available. When calling this entry directly, pass validated arguments that match the signature and handle failures according to the return-value convention.
@param
- hUnderlying runtime handle.
- file_handleNative file handle used by the asynchronous file operation.
- eventsEvent mask or event collection observed by the polling operation.
@returnReturns the operation result as `Int`.
functionnet.poll::__poller_del_file
Signature
extern func __poller_del_file(h: Int, file_handle: Int) -> Int;extern func __poller_del_file(h: Int, file_handle: Int) -> Int;
/*
@brief Binds the low-level runtime symbol `__poller_wait`.@briefBinds the low-level runtime symbol `__poller_del_file`.
@detailsThis function is an external entry point used by system modules to access native runtime capabilities such as filesystem, networking, threading, GC, cryptography, or platform operations. Prefer the safe wrapper functions in the same file when available. When calling this entry directly, pass validated arguments that match the signature and handle failures according to the return-value convention.
@param
- hUnderlying runtime handle.
- file_handleNative file handle used by the asynchronous file operation.
@returnReturns the operation result as `Int`.
functionnet.poll::__poller_wait
Signature
extern func __poller_wait(h: Int, timeout_ms: Int, out_vec_h: Int) -> Int;extern func __poller_wait(h: Int, timeout_ms: Int, out_vec_h: Int) -> Int;
/*@briefBinds the low-level runtime symbol `__poller_wait`.
@detailsThis function is an external entry point used by system modules to access native runtime capabilities such as filesystem, networking, threading, GC, cryptography, or platform operations. Prefer the safe wrapper functions in the same file when available. When calling this entry directly, pass validated arguments that match the signature and handle failures according to the return-value convention.
@param
- hUnderlying runtime handle.
- timeout_msTimeout in milliseconds; negative values usually select blocking or default timeout behavior.
- out_vec_hNative handle used to identify the out vec handle resource.
@returnReturns the operation result as `Int`.
functionnet.poll::Poller.init
Signature
func init(self: net.poll.Poller) -> Void func init(self: net.poll.Poller) -> Void {
self.h = __poller_new();
_ = __poller_bind_gc(self);@briefInitializes a `Poller` instance.
@detailsEstablishes the initial field state for `Poller` so other methods can be called safely. Constructor logic should keep fields consistent and avoid leaking partially initialized resources.
@param
- selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
@returnVoid
functionnet.poll::Poller.free
Signature
func free(self: net.poll.Poller) -> Void func free(self: net.poll.Poller) -> Void {
_ = __poller_free(self.h);
self.h = 0;@briefProvides the system library operation `Poller.free`.
@detailsExecutes the `free` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
- selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
@returnVoid
functionnet.poll::Poller.dispose
Signature
func dispose(self: net.poll.Poller) -> Void func dispose(self: net.poll.Poller) -> Void {
if self.h != 0 {
_ = self.free();@briefExplicitly releases resources owned by `Poller`.
@detailsThis method deterministically cleans up file descriptors, network connections, native handles, buffers, or other external resources. Implementations should be idempotent where possible, and repeated calls must not corrupt object state.
@param
- selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
@returnVoid
functionnet.poll::Poller.deinit
Signature
func deinit(self: net.poll.Poller) -> Void func deinit(self: net.poll.Poller) -> Void {
if self.h != 0 {
_ = self.free();@briefReleases fallback resources at the end of the `Poller` lifetime.
@detailsThis destructor hook is called by object lifetime management to clean up underlying resources that were not released explicitly. Normal application code should prefer `dispose`, `close`, or the module-specific close function to release resources at a deterministic time.
@param
- selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
@returnVoid
functionnet.poll::Poller.add
Signature
func add(self: net.poll.Poller, fd: Int, events: Int) -> Bool func add(self: net.poll.Poller, fd: Int, events: Int) -> Bool {
return __poller_add(self.h, fd, events) == 1;
}@briefProvides the system library operation `Poller.add`.
@detailsExecutes the `add` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
- selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
- fdOperating-system file descriptor or socket descriptor.
- eventsEvent mask or event collection observed by the polling operation.
@returnReturns a boolean result; true means the condition holds or the operation succeeded.
functionnet.poll::Poller.del
Signature
func del(self: net.poll.Poller, fd: Int) -> Bool func del(self: net.poll.Poller, fd: Int) -> Bool {
return __poller_del(self.h, fd) == 1;
}@briefProvides the system library operation `Poller.del`.
@detailsExecutes the `del` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
- selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
- fdOperating-system file descriptor or socket descriptor.
@returnReturns a boolean result; true means the condition holds or the operation succeeded.
functionnet.poll::Poller.add_file
Signature
func add_file(self: net.poll.Poller, file_handle: Int, events: Int) -> Bool func add_file(self: net.poll.Poller, file_handle: Int, events: Int) -> Bool {
return __poller_add_file(self.h, file_handle, events) == 1;
}@briefProvides the system library operation `Poller.add_file`.
@detailsExecutes the `add_file` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
- selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
- file_handleNative file handle used by the asynchronous file operation.
- eventsEvent mask or event collection observed by the polling operation.
@returnReturns a boolean result; true means the condition holds or the operation succeeded.
functionnet.poll::Poller.del_file
Signature
func del_file(self: net.poll.Poller, file_handle: Int) -> Bool func del_file(self: net.poll.Poller, file_handle: Int) -> Bool {
return __poller_del_file(self.h, file_handle) == 1;
}@briefProvides the system library operation `Poller.del_file`.
@detailsExecutes the `del_file` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
- selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
- file_handleNative file handle used by the asynchronous file operation.
@returnReturns a boolean result; true means the condition holds or the operation succeeded.
functionnet.poll::Poller.wait
Signature
func wait(self: net.poll.Poller, timeout_ms: Int, out: collections.Vector<Int>) -> Int func wait(self: net.poll.Poller, timeout_ms: Int, out: collections.Vector<Int>) -> Int {
return __poller_wait(self.h, timeout_ms, out.h);
}@briefProvides the system library operation `Poller.wait`.
@detailsExecutes the `wait` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
- selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
- timeout_msTimeout in milliseconds; negative values usually select blocking or default timeout behavior.
- outOutput buffer, vector, pointer, or destination that receives produced data.
@returnReturns the operation result as `Int`.
Variables
Class fields (var).
varnet.poll::Poller.h
Type
Int@brief`h` field.
@detailsStores the underlying runtime handle. The field type is `Int`, and it is maintained by the constructors and methods of `Poller`.
var h: Int;
/*