Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.oxd.sh/llms.txt

Use this file to discover all available pages before exploring further.

Every SDK function that can fail returns an OxAccelError enum value.

Error table

CodeNameDescriptionCommon cause
0OkSuccess
1InvalidParamNULL pointer or invalid argumentPassing NULL context or data pointer
2InitFailedRuntime or connection initialization failedRelay unreachable, DNS failure, port blocked
3NotConnectedNot connectedCalling send/recv before connect
4SendFailedNetwork send errorConnection dropped, relay unreachable
5RecvFailedNetwork receive errorConnection dropped, timeout
6TimeoutOperation timed outNetwork congestion, relay overloaded
7BufferTooSmallReceive buffer too smallIncrease buf_len in ox_accel_recv

Handling errors

OxAccelError err = ox_accel_connect(ctx);
switch (err) {
    case OxAccelError_Ok:
        break;
    case OxAccelError_InitFailed:
        fprintf(stderr, "Could not reach relay\n");
        ox_accel_destroy(ctx);
        return 1;
    default:
        fprintf(stderr, "Unexpected error: %d\n", err);
        ox_accel_destroy(ctx);
        return 1;
}
Always check the return value. The only functions that never fail are ox_accel_destroy (NULL-safe no-op) and ox_accel_version.