Helix Core is now P4. Product user interfaces will be updated soon. Learn more >>

C/C++ API Documentation | 2025.1

# ClientApi - P4 Server connections and commands

The `ClientApi` class represents a connection with the P4 Server.

Member functions in this class are used to establish and terminate the connection with the server, establish the settings and protocols to use while running commands, and run P4 Server commands over the connection.

I/O is handled by a `ClientUser` object, and errors are captured in an `Error` object. A `ClientApi` object maintains information about client-side settings (`P4PORT`, etc.) and protocol information, such as the server version, and whether "tagged" output is enabled.

`ClientApi` does not include any virtual functions, and typically does not need to be subclassed.

Any P4 Server command that is executed must be invoked through `ClientApi::Run()` after first opening a connection using `ClientApi::Init()`. A single connection can be used to invoke multiple commands by calling `Run()` multiple times after a single `Init()`; this approach provides faster performance than using multiple connections.

Your search for returned results