Esc

Channel

structextensionsince 0.36.1Source
  • macOS: Channel works on macOS
  • Linux: Channel works on Linux
  • Windows: Channel works on Windows
  • Wasm: Channel works on Wasm

Declaration

Channel :: struct {
    transport: Http.Http2_Channel;    max_active_calls := 128;    active_calls: int;}

Scheduler-bound RPC scope. Keep its address and TLS configuration stable until all calls and close_channel finish; active call and connection limits bound admission.

Example
Tls :: #import "Extensions/Tls";

main :: () {
    config: Tls.Tls_Config;
    config.alpn = string.["h2"];
    Tls.tls_config_init(*config);
    defer Tls.tls_config_free(*config);

    channel: Channel;
    channel.transport.base_url = "https://localhost:50051";
    channel.transport.tls = *config;
    defer close_channel(*channel);
}

See also