Configure the Client-Server Connection

You configure the client-server connection using a structure of type mpsClientConfig. The structure has fields to configure:

  • amount of time, in milliseconds, the client waits for a response before timing out.

  • maximum size, in bytes, of the response a client accepts.

  • security parameters.

You can use methods provided by the mpsClientConfig structure, to change the values before you create the client context.

Create a Connection with the Default Configuration

When you create the client configuration using the runtime API createConfig() function, it is populated with default values:

  • responseTimeOut = 120000

  • reponseSizeLimit = 64*1024*1024 (64 MB)

mpsClientConfig* config;
mpsStatus status = mpsruntime->createConfig(&config);

Change the Response Time Out

To change the amount of time the client waits for a response use the setTimeOutSec() function provided by the mpsClientRuntime structure.

This code sample creates a client connection with a time out value of 1000 ms:

mpsClientConfig* config;
mpsStatus status = mpsruntime->createConfig(&config);
mpsruntime->setResponseTimeOutSec(config, 1000); 

Tip

Setting the response time out to 0 specifies that the client will wait indefinitely for a response.

Change the Response Size Limit

To change the amount of data a client will accept in a response use the setResponseSizeLimit() function provided by the mpsClientConfig structure.

This code sample creates a client connection that accepts a maximum of 4 MB in a response:

mpsClientConfig* config;
mpsStatus status = mpsruntime->createConfig(&config);
config->setResponseSizeLimit(4*1024*1024);