Skip to content

한국어 | English

Specification Index | Next: Public Contract Governance

ZLink Core Specification

What this chapter defines — The index of the complete Core C API specification and the scope covered by each chapter.

This index links the Core public C ABI contract documentation exposed by zlink.h. Each contract document describes only public contracts; it does not define internals such as source directories, socket wiring, or queue structure as contracts. Internal structures related to a contract are covered in the "Internals" section of the same document, while cross-cutting topics spanning multiple documents are covered in the systems documents.

1. Reading Order

The following order is recommended for first-time readers. Each chapter can be read independently, but this order follows the direction in which later chapters build on concepts introduced earlier.

  1. Context — Start with the top-level container to which every socket belongs.
  2. Message — The unit of data exchanged by sockets and its ownership rules.
  3. Socket Common Contracts — Lifecycle, options, and send and receive forms common to all socket types.
  4. Individual socket documents — Read only the chapter for the socket type you use (from PAIR through STREAM).
  5. Errors — Finish with the result and errno system shared by all functions.

For wire protocols, events, polling, monitoring, and internal system structure, use the task-based index as needed.

2. Common Contracts

Document Content
Public Contract Governance Procedure for keeping specifications, headers, tests, and packages consistent
Context Context creation, shutdown, and configuration
Message Message lifecycle, routing IDs, ownership, and multipart internals
Errors Public result enums, errno, version, and the result-errno mapping
Events Common event types and readiness semantics
Polling Poll items, pollers, and the source support matrix
Monitoring Raw socket monitors and status snapshots
Utilities Timers, threads, stopwatches, and atomic helpers
Runtime Boundary Responsibility boundary between the Core raw C ABI and Framework services, and the internal layer structure

3. Socket Contracts

Document Content
Socket Common Contracts Common lifecycle, options, send and receive operations, and internal option defaults
Socket — PAIR One-to-one connection
Socket — PUB Classic fanout publisher
Socket — SUB Classic fanout subscriber
Socket — XPUB Subscription-aware publisher
Socket — XSUB Upstream subscription socket
Socket — DEALER Asynchronous request socket
Socket — ROUTER Routing-ID-based raw router
Socket — STREAM Raw TCP/WS session socket and internal WS/WSS optimizations

4. Wire Protocols

Document Content
Protocol Index of the ZMP and RAW protocol documents
Protocol — ZMP v1.0 ZMP v1.0 wire protocol
Protocol — RAW RAW wire protocol used by STREAM

5. Cross-Cutting System Structure

Document Content
Systems Index of Core internal system documents
Core Runtime Architecture Internal components from the public API to the I/O threads
Core Threading Model Thread types and responsibilities
I/O Thread I/O thread creation and work distribution
Thread Safety Implementation of the three-tier thread-safety contract
Connection Memory Per-connection memory components
Auto HWM Auto HWM budget contract and internal structure
Core Source Layout Source directory structure and include direction
Core POSD Module Structure Separation of responsibilities by layer
Core Design Decisions Key design decisions
Core Hot Path Rules and performance gates for the per-message path

6. Task-Based Index

If you know the task you need to perform, use the table below to find the starting document. The linked document owns the contract it describes.

Task Start Here
Implement a language binding Read the complete Reading Order, then Events, Polling, Monitoring, and Utilities
Implement error handling Errors and the errors section of the socket chapter you use
Wait for socket readiness or monitor multiple sockets Events, Polling, and Monitoring
Interoperate with another language or implementation at the wire level Protocol — ZMP v1.0 and Protocol — RAW
Understand queue sizing and memory use Auto HWM and Connection Memory
Maintain Core internals Start with Systems and read in order
Change specifications, headers, and tests together Public Contract Governance
Confirm the boundary for adding a higher layer on top of Core Runtime Boundary

Specification Index | Next: Public Contract Governance