EgretDoc
Back to Home
Location:system/aio.tcp

Module

Module documentation.

moduleaio.tcp

Classes

Classes and inheritance.

Functions

Free functions and class methods.

functionaio.tcp::__aio_tcp_connect
Signatureextern func __aio_tcp_connect(host: String, port: Int, timeout_ms: Int) -> Future(Int, ErrCode);
extern func __aio_tcp_connect(host: String, port: Int, timeout_ms: Int) -> Future(Int, ErrCode);
/*
@brief Binds the low-level runtime symbol `__aio_tcp_listen`.
@briefBinds the low-level runtime symbol `__aio_tcp_connect`.
@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
  • hostHost name or listen address.
  • portPort number.
  • timeout_msTimeout in milliseconds; negative values usually select blocking or default timeout behavior.
@returnVoid
functionaio.tcp::__aio_tcp_listen
Signatureextern func __aio_tcp_listen(host: String, port: Int, backlog: Int) -> Int;
extern func __aio_tcp_listen(host: String, port: Int, backlog: Int) -> Int;
/*
@brief Binds the low-level runtime symbol `__aio_tcp_accept`.
@briefBinds the low-level runtime symbol `__aio_tcp_listen`.
@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
  • hostHost name or listen address.
  • portPort number.
  • backlogMaximum number of pending inbound connections accepted by the listening socket.
@returnReturns the operation result as `Int`.
functionaio.tcp::__aio_tcp_accept
Signatureextern func __aio_tcp_accept(fd: Int, timeout_ms: Int) -> Future(Int, ErrCode);
extern func __aio_tcp_accept(fd: Int, timeout_ms: Int) -> Future(Int, ErrCode);
/*
@brief Binds the low-level runtime symbol `__aio_tcp_sock_port`.
@briefBinds the low-level runtime symbol `__aio_tcp_accept`.
@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
  • fdOperating-system file descriptor or socket descriptor.
  • timeout_msTimeout in milliseconds; negative values usually select blocking or default timeout behavior.
@returnVoid
functionaio.tcp::__aio_tcp_sock_port
Signatureextern func __aio_tcp_sock_port(fd: Int) -> Int;
extern func __aio_tcp_sock_port(fd: Int) -> Int;
/*
@brief Binds the low-level runtime symbol `__aio_tcp_peer_host`.
@briefBinds the low-level runtime symbol `__aio_tcp_sock_port`.
@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
  • fdOperating-system file descriptor or socket descriptor.
@returnReturns the operation result as `Int`.
functionaio.tcp::__aio_tcp_peer_host
Signatureextern func __aio_tcp_peer_host(fd: Int) -> String;
extern func __aio_tcp_peer_host(fd: Int) -> String;
/*
@brief Binds the low-level runtime symbol `__aio_tcp_peer_port`.
@briefBinds the low-level runtime symbol `__aio_tcp_peer_host`.
@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
  • fdOperating-system file descriptor or socket descriptor.
@returnReturns the operation result as `String`.
functionaio.tcp::__aio_tcp_peer_port
Signatureextern func __aio_tcp_peer_port(fd: Int) -> Int;
extern func __aio_tcp_peer_port(fd: Int) -> Int;
/*
@brief Binds the low-level runtime symbol `__aio_tcp_send`.
@briefBinds the low-level runtime symbol `__aio_tcp_peer_port`.
@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
  • fdOperating-system file descriptor or socket descriptor.
@returnReturns the operation result as `Int`.
functionaio.tcp::__aio_tcp_send
Signatureextern func __aio_tcp_send(fd: Int, data: String, timeout_ms: Int) -> Future(Int, ErrCode);
extern func __aio_tcp_send(fd: Int, data: String, timeout_ms: Int) -> Future(Int, ErrCode);
/*
@brief Binds the low-level runtime symbol `__aio_tcp_recv`.
@briefBinds the low-level runtime symbol `__aio_tcp_send`.
@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
  • fdOperating-system file descriptor or socket descriptor.
  • dataInput or output data buffer.
  • timeout_msTimeout in milliseconds; negative values usually select blocking or default timeout behavior.
@returnVoid
functionaio.tcp::__aio_tcp_recv
Signatureextern func __aio_tcp_recv(fd: Int, max_bytes: Int, timeout_ms: Int) -> Future(String, ErrCode);
extern func __aio_tcp_recv(fd: Int, max_bytes: Int, timeout_ms: Int) -> Future(String, ErrCode);
/*
@brief Binds the low-level runtime symbol `__aio_tcp_close`.
@briefBinds the low-level runtime symbol `__aio_tcp_recv`.
@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
  • fdOperating-system file descriptor or socket descriptor.
  • max_bytesMaximum number of bytes to read or process in this operation.
  • timeout_msTimeout in milliseconds; negative values usually select blocking or default timeout behavior.
@returnVoid
functionaio.tcp::__aio_tcp_close
Signatureextern func __aio_tcp_close(fd: Int) -> Void;
extern func __aio_tcp_close(fd: Int) -> Void;

/*
@briefBinds the low-level runtime symbol `__aio_tcp_close`.
@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
  • fdOperating-system file descriptor or socket descriptor.
@returnVoid
functionaio.tcp::connect
Signaturefunc connect(host: String, port: Int, timeout_ms: Int) -> Future(Int, ErrCode)
func connect(host: String, port: Int, timeout_ms: Int) -> Future(Int, ErrCode) {
    return __aio_tcp_connect(host, port, timeout_ms);
}
@briefEstablishes a connection with `connect`.
@detailsExecutes the `connect` 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
  • hostHost name or listen address.
  • portPort number.
  • timeout_msTimeout in milliseconds; negative values usually select blocking or default timeout behavior.
@returnVoid
functionaio.tcp::listen
Signaturefunc listen(host: String, port: Int, backlog: Int) -> Int, ErrCode
func listen(host: String, port: Int, backlog: Int) -> Int, ErrCode {
    let fd: Int = __aio_tcp_listen(host, port, backlog);
    return fd, aio.error_code_from_int_result(fd);
@briefCreates a listening endpoint with `listen`.
@detailsExecutes the `listen` 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
  • hostHost name or listen address.
  • portPort number.
  • backlogMaximum number of pending inbound connections accepted by the listening socket.
@returnReturns `Int, ErrCode`; on success the error code is `std.OK` or `OK`, and on failure the error code describes the failure while any returned value contains the usable partial result when available.
functionaio.tcp::accept
Signaturefunc accept(fd: Int, timeout_ms: Int) -> Future(Int, ErrCode)
func accept(fd: Int, timeout_ms: Int) -> Future(Int, ErrCode) {
    return __aio_tcp_accept(fd, timeout_ms);
}
@briefAccepts an incoming connection with `accept`.
@detailsExecutes the `accept` 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
  • fdOperating-system file descriptor or socket descriptor.
  • timeout_msTimeout in milliseconds; negative values usually select blocking or default timeout behavior.
@returnVoid
functionaio.tcp::sock_port
Signaturefunc sock_port(fd: Int) -> Int, ErrCode
func sock_port(fd: Int) -> Int, ErrCode {
    let p: Int = __aio_tcp_sock_port(fd);
    return p, aio.error_code_from_int_result(p);
@briefProvides the system library operation `sock_port`.
@detailsExecutes the `sock_port` 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
  • fdOperating-system file descriptor or socket descriptor.
@returnReturns `Int, ErrCode`; on success the error code is `std.OK` or `OK`, and on failure the error code describes the failure while any returned value contains the usable partial result when available.
functionaio.tcp::peer_host
Signaturefunc peer_host(fd: Int) -> String
func peer_host(fd: Int) -> String {
    return __aio_tcp_peer_host(fd);
}
@briefProvides the system library operation `peer_host`.
@detailsExecutes the `peer_host` 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
  • fdOperating-system file descriptor or socket descriptor.
@returnReturns the operation result as `String`.
functionaio.tcp::peer_port
Signaturefunc peer_port(fd: Int) -> Int, ErrCode
func peer_port(fd: Int) -> Int, ErrCode {
    let p: Int = __aio_tcp_peer_port(fd);
    if p <= 0 {
@briefProvides the system library operation `peer_port`.
@detailsExecutes the `peer_port` 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
  • fdOperating-system file descriptor or socket descriptor.
@returnReturns `Int, ErrCode`; on success the error code is `std.OK` or `OK`, and on failure the error code describes the failure while any returned value contains the usable partial result when available.
functionaio.tcp::send
Signaturefunc send(fd: Int, data: String, timeout_ms: Int) -> Future(Int, ErrCode)
func send(fd: Int, data: String, timeout_ms: Int) -> Future(Int, ErrCode) {
    return __aio_tcp_send(fd, data, timeout_ms);
}
@briefSends data with `send`.
@detailsExecutes the `send` 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
  • fdOperating-system file descriptor or socket descriptor.
  • dataInput or output data buffer.
  • timeout_msTimeout in milliseconds; negative values usually select blocking or default timeout behavior.
@returnVoid
functionaio.tcp::recv
Signaturefunc recv(fd: Int, max_bytes: Int, timeout_ms: Int) -> Future(String, ErrCode)
func recv(fd: Int, max_bytes: Int, timeout_ms: Int) -> Future(String, ErrCode) {
    return __aio_tcp_recv(fd, max_bytes, timeout_ms);
}
@briefReceives data with `recv`.
@detailsExecutes the `recv` 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
  • fdOperating-system file descriptor or socket descriptor.
  • max_bytesMaximum number of bytes to read or process in this operation.
  • timeout_msTimeout in milliseconds; negative values usually select blocking or default timeout behavior.
@returnVoid
functionaio.tcp::close
Signaturefunc close(fd: Int) -> Void
func close(fd: Int) -> Void {
    _ = __aio_tcp_close(fd);
    return;
@briefCloses resources and makes later operations unavailable with `close`.
@detailsExecutes the `close` 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
  • fdOperating-system file descriptor or socket descriptor.
@returnVoid

Variables

Class fields (var).