EgretDoc
Back to Home
Location:system/aio.tls

Module

Module documentation.

moduleaio.tls

Classes

Classes and inheritance.

Functions

Free functions and class methods.

functionaio.tls::__aio_tls_connect
Signatureextern func __aio_tls_connect(host: String, port: Int, timeout_ms: Int) -> Future(Int, ErrCode);
extern func __aio_tls_connect(host: String, port: Int, timeout_ms: Int) -> Future(Int, ErrCode);
/*
@brief Binds the low-level runtime symbol `__aio_tls_connect_ex`.
@briefBinds the low-level runtime symbol `__aio_tls_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.tls::__aio_tls_connect_ex
Signatureextern func __aio_tls_connect_ex(host: String, port: Int, timeout_ms: Int, verify: Int, ca_file: String) -> Future(Int, ErrCode);
extern func __aio_tls_connect_ex(host: String, port: Int, timeout_ms: Int, verify: Int, ca_file: String) -> Future(Int, ErrCode);
/*
@brief Binds the low-level runtime symbol `__aio_tls_upgrade_client_fd`.
@briefBinds the low-level runtime symbol `__aio_tls_connect_ex`.
@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.
  • verifyWhether certificate or identity verification is required for the TLS operation.
  • ca_fileFilesystem path to the certificate authority bundle used for TLS verification.
@returnVoid
functionaio.tls::__aio_tls_upgrade_client_fd
Signatureextern func __aio_tls_upgrade_client_fd(fd: Int, host: String, timeout_ms: Int) -> Future(Int, ErrCode);
extern func __aio_tls_upgrade_client_fd(fd: Int, host: String, timeout_ms: Int) -> Future(Int, ErrCode);
/*
@brief Binds the low-level runtime symbol `__aio_tls_upgrade_client_fd_ex`.
@briefBinds the low-level runtime symbol `__aio_tls_upgrade_client_fd`.
@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.
  • hostHost name or listen address.
  • timeout_msTimeout in milliseconds; negative values usually select blocking or default timeout behavior.
@returnVoid
functionaio.tls::__aio_tls_upgrade_client_fd_ex
Signatureextern func __aio_tls_upgrade_client_fd_ex(fd: Int, host: String, timeout_ms: Int, verify: Int, ca_file: String) -> Future(Int, ErrCode);
extern func __aio_tls_upgrade_client_fd_ex(fd: Int, host: String, timeout_ms: Int, verify: Int, ca_file: String) -> Future(Int, ErrCode);
/*
@brief Binds the low-level runtime symbol `__aio_tls_listen`.
@briefBinds the low-level runtime symbol `__aio_tls_upgrade_client_fd_ex`.
@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.
  • hostHost name or listen address.
  • timeout_msTimeout in milliseconds; negative values usually select blocking or default timeout behavior.
  • verifyWhether certificate or identity verification is required for the TLS operation.
  • ca_fileFilesystem path to the certificate authority bundle used for TLS verification.
@returnVoid
functionaio.tls::__aio_tls_listen
Signatureextern func __aio_tls_listen(host: String, port: Int, backlog: Int, cert_file: String, key_file: String) -> Int;
extern func __aio_tls_listen(host: String, port: Int, backlog: Int, cert_file: String, key_file: String) -> Int;
/*
@brief Binds the low-level runtime symbol `__aio_tls_add_server_cert`.
@briefBinds the low-level runtime symbol `__aio_tls_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.
  • cert_fileFilesystem path to the TLS certificate file.
  • key_fileFilesystem path to the TLS private key file.
@returnReturns the operation result as `Int`.
functionaio.tls::__aio_tls_add_server_cert
Signatureextern func __aio_tls_add_server_cert(h: Int, server_name: String, cert_file: String, key_file: String) -> Int;
extern func __aio_tls_add_server_cert(h: Int, server_name: String, cert_file: String, key_file: String) -> Int;
/*
@brief Binds the low-level runtime symbol `__aio_tls_accept`.
@briefBinds the low-level runtime symbol `__aio_tls_add_server_cert`.
@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.
  • server_nameServer name used for TLS SNI, routing, or protocol identification.
  • cert_fileFilesystem path to the TLS certificate file.
  • key_fileFilesystem path to the TLS private key file.
@returnReturns the operation result as `Int`.
functionaio.tls::__aio_tls_accept
Signatureextern func __aio_tls_accept(h: Int, timeout_ms: Int) -> Future(Int, ErrCode);
extern func __aio_tls_accept(h: Int, timeout_ms: Int) -> Future(Int, ErrCode);
/*
@brief Binds the low-level runtime symbol `__aio_tls_send`.
@briefBinds the low-level runtime symbol `__aio_tls_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
  • hUnderlying runtime handle.
  • timeout_msTimeout in milliseconds; negative values usually select blocking or default timeout behavior.
@returnVoid
functionaio.tls::__aio_tls_send
Signatureextern func __aio_tls_send(h: Int, data: String, timeout_ms: Int) -> Future(Int, ErrCode);
extern func __aio_tls_send(h: Int, data: String, timeout_ms: Int) -> Future(Int, ErrCode);
/*
@brief Binds the low-level runtime symbol `__aio_tls_recv`.
@briefBinds the low-level runtime symbol `__aio_tls_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
  • hUnderlying runtime handle.
  • dataInput or output data buffer.
  • timeout_msTimeout in milliseconds; negative values usually select blocking or default timeout behavior.
@returnVoid
functionaio.tls::__aio_tls_recv
Signatureextern func __aio_tls_recv(h: Int, max_bytes: Int, timeout_ms: Int) -> Future(String, ErrCode);
extern func __aio_tls_recv(h: Int, max_bytes: Int, timeout_ms: Int) -> Future(String, ErrCode);
/*
@brief Binds the low-level runtime symbol `__aio_tls_server_name`.
@briefBinds the low-level runtime symbol `__aio_tls_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
  • hUnderlying runtime handle.
  • 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.tls::__aio_tls_server_name
Signatureextern func __aio_tls_server_name(h: Int) -> String;
extern func __aio_tls_server_name(h: Int) -> String;
/*
@brief Binds the low-level runtime symbol `__aio_tls_peer_host`.
@briefBinds the low-level runtime symbol `__aio_tls_server_name`.
@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.
@returnReturns the operation result as `String`.
functionaio.tls::__aio_tls_peer_host
Signatureextern func __aio_tls_peer_host(h: Int) -> String;
extern func __aio_tls_peer_host(h: Int) -> String;
/*
@brief Binds the low-level runtime symbol `__aio_tls_peer_port`.
@briefBinds the low-level runtime symbol `__aio_tls_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
  • hUnderlying runtime handle.
@returnReturns the operation result as `String`.
functionaio.tls::__aio_tls_peer_port
Signatureextern func __aio_tls_peer_port(h: Int) -> Int;
extern func __aio_tls_peer_port(h: Int) -> Int;
/*
@brief Binds the low-level runtime symbol `__aio_tls_close`.
@briefBinds the low-level runtime symbol `__aio_tls_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
  • hUnderlying runtime handle.
@returnReturns the operation result as `Int`.
functionaio.tls::__aio_tls_close
Signatureextern func __aio_tls_close(h: Int) -> Void;
extern func __aio_tls_close(h: Int) -> Void;

/*
@briefBinds the low-level runtime symbol `__aio_tls_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
  • hUnderlying runtime handle.
@returnVoid
functionaio.tls::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_tls_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.tls::connect_ex
Signaturefunc connect_ex(host: String, port: Int, timeout_ms: Int, verify: Bool = false, ca_file: String = "") -> Future(Int, ErrCode)
func connect_ex(host: String, port: Int, timeout_ms: Int, verify: Bool = false, ca_file: String = "") -> Future(Int, ErrCode) {
    let verify_flag: Int = 0;
    if verify {
@briefProvides the system library operation `connect_ex`.
@detailsExecutes the `connect_ex` 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.
  • verifyWhether certificate or identity verification is required for the TLS operation.
  • ca_fileFilesystem path to the certificate authority bundle used for TLS verification.
@returnVoid
functionaio.tls::upgrade_client_fd
Signaturefunc upgrade_client_fd(fd: Int, host: String, timeout_ms: Int) -> Future(Int, ErrCode)
func upgrade_client_fd(fd: Int, host: String, timeout_ms: Int) -> Future(Int, ErrCode) {
    return __aio_tls_upgrade_client_fd(fd, host, timeout_ms);
}
@briefProvides the system library operation `upgrade_client_fd`.
@detailsExecutes the `upgrade_client_fd` 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.
  • hostHost name or listen address.
  • timeout_msTimeout in milliseconds; negative values usually select blocking or default timeout behavior.
@returnVoid
functionaio.tls::upgrade_client_fd_ex
Signaturefunc upgrade_client_fd_ex(fd: Int, host: String, timeout_ms: Int, verify: Bool = false, ca_file: String = "") -> Future(Int, ErrCode)
func upgrade_client_fd_ex(fd: Int, host: String, timeout_ms: Int, verify: Bool = false, ca_file: String = "") -> Future(Int, ErrCode) {
    let verify_flag: Int = 0;
    if verify {
@briefProvides the system library operation `upgrade_client_fd_ex`.
@detailsExecutes the `upgrade_client_fd_ex` 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.
  • hostHost name or listen address.
  • timeout_msTimeout in milliseconds; negative values usually select blocking or default timeout behavior.
  • verifyWhether certificate or identity verification is required for the TLS operation.
  • ca_fileFilesystem path to the certificate authority bundle used for TLS verification.
@returnVoid
functionaio.tls::listen
Signaturefunc listen(host: String, port: Int, backlog: Int, cert_file: String, key_file: String) -> Int, ErrCode
func listen(host: String, port: Int, backlog: Int, cert_file: String, key_file: String) -> Int, ErrCode {
    let h = __aio_tls_listen(host, port, backlog, cert_file, key_file);
    return h, aio.error_code_from_int_result(h);
@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.
  • cert_fileFilesystem path to the TLS certificate file.
  • key_fileFilesystem path to the TLS private key file.
@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.tls::add_server_cert
Signaturefunc add_server_cert(h: Int, server_name: String, cert_file: String, key_file: String) -> Int, ErrCode
func add_server_cert(h: Int, server_name: String, cert_file: String, key_file: String) -> Int, ErrCode {
    let rc = __aio_tls_add_server_cert(h, server_name, cert_file, key_file);
    return rc, aio.error_code_from_int_result(rc);
@briefProvides the system library operation `add_server_cert`.
@detailsExecutes the `add_server_cert` 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
  • hUnderlying runtime handle.
  • server_nameServer name used for TLS SNI, routing, or protocol identification.
  • cert_fileFilesystem path to the TLS certificate file.
  • key_fileFilesystem path to the TLS private key file.
@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.tls::accept
Signaturefunc accept(h: Int, timeout_ms: Int) -> Future(Int, ErrCode)
func accept(h: Int, timeout_ms: Int) -> Future(Int, ErrCode) {
    return __aio_tls_accept(h, 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
  • hUnderlying runtime handle.
  • timeout_msTimeout in milliseconds; negative values usually select blocking or default timeout behavior.
@returnVoid
functionaio.tls::send
Signaturefunc send(h: Int, data: String, timeout_ms: Int) -> Future(Int, ErrCode)
func send(h: Int, data: String, timeout_ms: Int) -> Future(Int, ErrCode) {
    return __aio_tls_send(h, 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
  • hUnderlying runtime handle.
  • dataInput or output data buffer.
  • timeout_msTimeout in milliseconds; negative values usually select blocking or default timeout behavior.
@returnVoid
functionaio.tls::recv
Signaturefunc recv(h: Int, max_bytes: Int, timeout_ms: Int) -> Future(String, ErrCode)
func recv(h: Int, max_bytes: Int, timeout_ms: Int) -> Future(String, ErrCode) {
    return __aio_tls_recv(h, 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
  • hUnderlying runtime handle.
  • 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.tls::server_name
Signaturefunc server_name(h: Int) -> String
func server_name(h: Int) -> String {
    return __aio_tls_server_name(h);
}
@briefProvides the system library operation `server_name`.
@detailsExecutes the `server_name` 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
  • hUnderlying runtime handle.
@returnReturns the operation result as `String`.
functionaio.tls::peer_host
Signaturefunc peer_host(h: Int) -> String
func peer_host(h: Int) -> String {
    return __aio_tls_peer_host(h);
}
@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
  • hUnderlying runtime handle.
@returnReturns the operation result as `String`.
functionaio.tls::peer_port
Signaturefunc peer_port(h: Int) -> Int, ErrCode
func peer_port(h: Int) -> Int, ErrCode {
    let p = __aio_tls_peer_port(h);
    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
  • hUnderlying runtime handle.
@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.tls::close
Signaturefunc close(h: Int) -> Void
func close(h: Int) -> Void {
    _ = __aio_tls_close(h);
    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
  • hUnderlying runtime handle.
@returnVoid

Variables

Class fields (var).