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

C/C++ API Documentation | 2026.1

# ClientApi::SetPort( const StrPtr * )

Sets the port to be used to open this connection.

Virtual? | No |
Class | `ClientApi` |
Arguments | `const StrPtr *c` | the new port value
Returns | `void` |

## Notes

`SetPort()` does not permanently change the `P4PORT` value in the environment. The new setting applies only to new connections established by calling this `ClientApi` object’s `Init()` method.

## Example

The following example demonstrates setting a new port value before initializing the connection.

    ClientApi client;
    Error e;
    StrBuf sb;

    sb = "ssl:magic:1666";

    client.SetPort( &sb );
    client.Init( &e );

Your search for returned results