Integratec API Platform
OPAPI OPBOOL opClientConnectionOpen ( wchar_t *  ip,
int32_t  port,
OPAPIStatusCallback  statusCallback,
OPAPIHandle *  connection,
wchar_t **  brokerId,
wchar_t **  errorMsg 
)

Opens and registers a client connection to a master.

Parameters
[in]ipMaster IP address, host name or endpoint.
[in]portMaster TCP port.
[in]statusCallbackCallback function that receives status updates for in progress requests.
[out]connectionHandle representing the client connection.
[out]brokerIdIdentity of the broker connected to.
[out]errorMsgError message describing the failure, set if the function fails.
Returns
If the function succeeds, the return value is non-zero, connection is set to a handle representing the client connection and brokerId is set to the identifier of the broker connected to.
If the function fails, the return value is zero and errorMsg is set to an error message describing the failure.
Usage
Specify the master IP address, host name or endpoint using the ip parameter and the master TCP port using the port parameter.
When specifying an endpoint, the ip parameter must be a URI of the form tcp://host:port and the port parameter must be 0.
If the statusCallback callback function is specified, it receives status updates for in progress requests.
Attention
Close the client connection using opClientConnectionClose when you no longer need it.
See also
OPAPIStatusCallback and opClientConnectionClose.