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

C/C++ API Documentation | 2025.2

# ClientApi::Final( Error * )

Close connection and return error count.

Virtual? | No |
Class | `ClientApi` |
Arguments | `Error *e` | an `Error` object
Returns | `int` | final number of errors

## Notes

Call this method after you are finished using the `ClientApi` object to clean up the connection. Every call to `Init()` must eventually be followed by exactly one call to `Final()`.

## Example

The following example is a slight modification of `p4api.cc`, and reports the number of errors before the program exits:

Copy

    client.Init( &e );

    client.SetArgv( argc - 2, argv + 2 );
    client.Run( argv[1], &ui );

    printf( "There were %d errors.\n", client.Final( &e ) );

Your search for returned results