Function rmw_destroy_client

Function Documentation

rmw_ret_t rmw_destroy_client(rmw_node_t *node, rmw_client_t *client)

Destroy and unregister a service client from its node.

This function will reclaim all associated resources, including the service client itself. Use of a destroyed service client is undefined behavior. This function will return early if a logical error, such as RMW_RET_INVALID_ARGUMENT or RMW_RET_INCORRECT_RMW_IMPLEMENTATION, ensues, leaving the given service client unchanged. Otherwise, it will proceed despite errors.

Attribute

Adherence

Allocates Memory

No

Thread-Safe

No

Uses Atomics

Maybe [1]

Lock-Free

Maybe [1]

[1] rmw implementation defined, check the implementation documentation

Parameters:
  • node[in] Node with which the given service client is registered.

  • client[in] Service client to be destroyed.

Pre:

Given node must be the one the service client was registered with.

Pre:

Given client must be a valid service client, as returned by rmw_create_service().

Returns:

RMW_RET_OK if successful, or

Returns:

RMW_RET_INVALID_ARGUMENT if node is NULL, or

Returns:

RMW_RET_INVALID_ARGUMENT if client is NULL, or

Returns:

RMW_RET_INCORRECT_RMW_IMPLEMENTATION if the node implementation identifier does not match this implementation, or

Returns:

RMW_RET_INCORRECT_RMW_IMPLEMENTATION if the client implementation identifier does not match this implementation, or

Returns:

RMW_RET_ERROR if an unspecified error occurs.