MATLAB Production Server C Client R2026a component: mds_c_client, module directory: deployment_server/client/c/mps, copyright: MathWorks |

Loading...
Searching...
No Matches
Data Fields
mpsClientRuntime Struct Reference

MATLAB Production Server client API container. More...

`#include <mps/client.h>`

## Data Fields
mpsStatus(* | createConfig )(mpsClientConfig **config)
| Initialize pointer to MATLAB Production Server client configuration instance with default values.
mpsStatus(* | createContext )(mpsClientContext **context, const mpsClientConfig *config)
| Initialize the MATLAB Production Server client execution context.
void(* | destroyConfig )(mpsClientConfig *config)
| Clean up the memory allocated to the client configuration instance.
void(* | destroyContext )(mpsClientContext *context)
| Clean up the memory allocated for the client execution context.
void(* | destroyLastErrorInfo )(mpsErrorInfo *errorInfo)
| Cleans up dynamic memory allocated while initializing mpsErrorInfo instance.
mpsStatus(* | feval )(mpsClientContext *context, const char *url, int nlhs, mpsArray *plhs[], int nrhs, const mpsArray *prhs[])
| Invoke MATLAB function hosted by a server instance and available at a Url.
const char *(* | getCAFile )(const mpsClientConfig *config)
| Get Certificate Authority file.
const char *(* | getClientCertFile )(const mpsClientConfig *config)
| Get client certificate file.
void(* | getLastErrorInfo )(mpsClientContext const *context, mpsErrorInfo *errorInfo)
| Access the error thrown while invoking a MATLAB function from the client A MATLAB function invocation failure can happen due to one of the following reasons:
const char *(* | getPrivateKeyFile )(const mpsClientConfig *config)
| Get the private key file.
const char *(* | getPrivateKeyPasswd )(const mpsClientConfig *config)
| Get password for private key file.
unsigned int(* | getResponseSizeLimit )(const mpsClientConfig *config)
| Get the responze size limit value, in bytes, for the client.
unsigned long(* | getResponseTimeOutSec )(const mpsClientConfig *config)
| Get the timeout value, in seconds, for the client to receive response from the server.
const char *(* | getRevocationListFile )(const mpsClientConfig *config)
| Get the revocation list file.
mpsLogical(* | getVerifyHost )(const mpsClientConfig *config)
| Get the host verification flag value.
mpsLogical(* | getVerifyPeer )(const mpsClientConfig *config)
| Get the peer verification flag value.
void(* | setCAFile )(mpsClientConfig *config, const char *caFile)
| Set file Certificate Authority file in PEM format.
void(* | setClientCertFile )(mpsClientConfig *config, const char *certFile)
| MPS_CLIENT_1_1 version provides support for request execution using HTTPS protocol for secure client-server communication.
void(* | setPrivateKeyFile )(mpsClientConfig *config, const char *pkFile)
| Set private key file in PEM format.
void(* | setPrivateKeyPasswd )(mpsClientConfig *config, const char *passwd)
| Set password for private key file.
void(* | setResponseSizeLimit )(mpsClientConfig *config, unsigned int value)
| Set the response size limit value, in bytes, for the client.
void(* | setResponseTimeOutSec )(mpsClientConfig *config, unsigned long value)
| Set the timeout value, in seconds, for the client to receive response from the server.
void(* | setRevocationListFile )(mpsClientConfig *config, const char *crlFile)
| Set the revocation list file.
void(* | setVerifyHost )(mpsClientConfig *config, mpsLogical verifyHost)
| Setting this flag to true will verify the hostname in thr url against the common name in the certificate.
void(* | setVerifyPeer )(mpsClientConfig *config, mpsLogical verifyPeer)
| Setting this flag to false will not peform the authentication of server certificate.

## Detailed Description

MATLAB Production Server client API container.

`mpsClientRuntime` provides functions needed to create the MATLAB Production Server client execution context, configure it, and use the execution context to execute MATLAB functions hosted by an MATLAB Production Server instance.

Definition at line 314 of file client.h.

## Field Documentation

## ◆ createConfig

mpsStatus(* mpsClientRuntime::createConfig) (mpsClientConfig **config)

Initialize pointer to MATLAB Production Server client configuration instance with default values.

The configuration parameters are used to configure the connection between client and MATLAB Production Server instance. Currently, the only parameter that can be initialized is the response timeout in seconds. This is the time the client will wait for the MATLAB Production Server instance to send the response. The default value is 120 seconds.

Parameters

  config | An uninitialized pointer to MATLAB Production Server client configuration instance.

Returns
  Status representing whether client configuration initialization was successful.

Definition at line 327 of file client.h.

## ◆ createContext

mpsStatus(* mpsClientRuntime::createContext) (mpsClientContext **context, const mpsClientConfig *config)

Initialize the MATLAB Production Server client execution context.

Execution context is initialized with the configuration parameters passed using MATLAB Production Server client configuration instance. The execution context encapsulates the HTTP framework required to execute MATLAB functions from the client. It also manages the connections between the client and the server instance. The execution context makes copy of the configuration being passed. As a result, the configuration pointer does not need to be kept around in the client application once the execution context has been created. You should use one execution context for every thread and it should not be shared across multiple threads.

Parameters

  context | Uninitialized memory location of pointer to the client context
  config | Pointer to the client-server connection configuration

Definition at line 358 of file client.h.

## ◆ destroyConfig

void(* mpsClientRuntime::destroyConfig) (mpsClientConfig *config)

Clean up the memory allocated to the client configuration instance.

Parameters

  config | Pointer to the client configuration that needs to be cleaned up

Definition at line 332 of file client.h.

## ◆ destroyContext

void(* mpsClientRuntime::destroyContext) (mpsClientContext *context)

Clean up the memory allocated for the client execution context.

This function cleans up all the resources used while invoking MATLAB functions from the client e.g the container for holding the last error. It also closes all the open connections between the client and the server instance created by the client execution context. Once destroyed, the execution context cannot be used to invoke MATLAB functions.

Parameters

  context | Pointer to the client context

Definition at line 368 of file client.h.

## ◆ destroyLastErrorInfo

void(* mpsClientRuntime::destroyLastErrorInfo) (mpsErrorInfo *errorInfo)

Cleans up dynamic memory allocated while initializing mpsErrorInfo instance.

Definition at line 387 of file client.h.

## ◆ feval

mpsStatus(* mpsClientRuntime::feval) (mpsClientContext *context, const char *url, int nlhs, mpsArray *plhs[], int nrhs, const mpsArray *prhs[])

Invoke MATLAB function hosted by a server instance and available at a Url.

MATLAB Production Server clients invoke MATLAB functions hosted by a server instance using a Url with the following format: `http://<hostname>:<port_number>/<archive_name>/<MATLAB_function_name>`.

The following Url exposes the MATLAB function `mymagic` deployed in `magic.ctf` at port 9910 localhost.

    http://localhost:9910/magic/mymagic

The inputs and outputs are of type `mpsArray`.

If the return status of this function is not success, the root cause of the failure is accessed by invoking `getLastErrorInfo()`.

Parameters

  context | Client context that holds a handle to the underlying HTTP framework instance
  url | Url to the MATLAB function
  nlhs | Number of outputs (number of left hand side parameters)
  plhs | Pointer to the output
  nrhs | Number of input arguments (number of right hand side parameters)
  prhs | Pointer to the inputs

Returns
  Status of execution.

Definition at line 411 of file client.h.

## ◆ getCAFile

const char *(* mpsClientRuntime::getCAFile) (const mpsClientConfig *config)

Get Certificate Authority file.

Definition at line 446 of file client.h.

## ◆ getClientCertFile

const char *(* mpsClientRuntime::getClientCertFile) (const mpsClientConfig *config)

Get client certificate file.

Definition at line 428 of file client.h.

## ◆ getLastErrorInfo

void(* mpsClientRuntime::getLastErrorInfo) (mpsClientContext const *context, mpsErrorInfo *errorInfo)

Access the error thrown while invoking a MATLAB function from the client A MATLAB function invocation failure can happen due to one of the following reasons:

1. MATLAB function threw an error
2. Client received a response code other than 200
3. Failure due to connection issues between the client and MATLAB Production Server instance The purpose of this function is to provide detailed information about the root cause of the failure. This function should be invoked only when the return status of MATLAB function invocation is a non-success status. Invoking this method when the MATLAB function invocation is successful will result in a undefined behaviour.
   Parameters

     context | MATLAB Production Server client context used to invoke the MATLAB function
     errorInfo | Struct containing detailed information regarding failed MATLAB function invocation

Definition at line 383 of file client.h.

## ◆ getPrivateKeyFile

const char *(* mpsClientRuntime::getPrivateKeyFile) (const mpsClientConfig *config)

Get the private key file.

Definition at line 434 of file client.h.

## ◆ getPrivateKeyPasswd

const char *(* mpsClientRuntime::getPrivateKeyPasswd) (const mpsClientConfig *config)

Get password for private key file.

Definition at line 440 of file client.h.

## ◆ getResponseSizeLimit

unsigned int(* mpsClientRuntime::getResponseSizeLimit) (const mpsClientConfig *config)

Get the responze size limit value, in bytes, for the client.

Definition at line 344 of file client.h.

## ◆ getResponseTimeOutSec

unsigned long(* mpsClientRuntime::getResponseTimeOutSec) (const mpsClientConfig *config)

Get the timeout value, in seconds, for the client to receive response from the server.

Definition at line 338 of file client.h.

## ◆ getRevocationListFile

const char *(* mpsClientRuntime::getRevocationListFile) (const mpsClientConfig *config)

Get the revocation list file.

Definition at line 452 of file client.h.

## ◆ getVerifyHost

mpsLogical(* mpsClientRuntime::getVerifyHost) (const mpsClientConfig *config)

Get the host verification flag value.

Definition at line 459 of file client.h.

## ◆ getVerifyPeer

mpsLogical(* mpsClientRuntime::getVerifyPeer) (const mpsClientConfig *config)

Get the peer verification flag value.

Definition at line 467 of file client.h.

## ◆ setCAFile

void(* mpsClientRuntime::setCAFile) (mpsClientConfig *config, const char *caFile)

Set file Certificate Authority file in PEM format.

Definition at line 443 of file client.h.

## ◆ setClientCertFile

void(* mpsClientRuntime::setClientCertFile) (mpsClientConfig *config, const char *certFile)

MPS_CLIENT_1_1 version provides support for request execution using HTTPS protocol for secure client-server communication.

Set client certificate file in PEM format.

Definition at line 425 of file client.h.

## ◆ setPrivateKeyFile

void(* mpsClientRuntime::setPrivateKeyFile) (mpsClientConfig *config, const char *pkFile)

Set private key file in PEM format.

Definition at line 431 of file client.h.

## ◆ setPrivateKeyPasswd

void(* mpsClientRuntime::setPrivateKeyPasswd) (mpsClientConfig *config, const char *passwd)

Set password for private key file.

Definition at line 437 of file client.h.

## ◆ setResponseSizeLimit

void(* mpsClientRuntime::setResponseSizeLimit) (mpsClientConfig *config, unsigned int value)

Set the response size limit value, in bytes, for the client.

Definition at line 341 of file client.h.

## ◆ setResponseTimeOutSec

void(* mpsClientRuntime::setResponseTimeOutSec) (mpsClientConfig *config, unsigned long value)

Set the timeout value, in seconds, for the client to receive response from the server.

Definition at line 335 of file client.h.

## ◆ setRevocationListFile

void(* mpsClientRuntime::setRevocationListFile) (mpsClientConfig *config, const char *crlFile)

Set the revocation list file.

Definition at line 449 of file client.h.

## ◆ setVerifyHost

void(* mpsClientRuntime::setVerifyHost) (mpsClientConfig *config, mpsLogical verifyHost)

Setting this flag to true will verify the hostname in thr url against the common name in the certificate.

Definition at line 456 of file client.h.

## ◆ setVerifyPeer

void(* mpsClientRuntime::setVerifyPeer) (mpsClientConfig *config, mpsLogical verifyPeer)

Setting this flag to false will not peform the authentication of server certificate.

Doing so will make the connection insecure and can be prone to man-in-the-middle attack

Definition at line 464 of file client.h.

The documentation for this struct was generated from the following file:

- mps/client.h