Function rmw_destroy_service

Function Documentation

rmw_ret_t rmw_destroy_service(rmw_node_t *node, rmw_service_t *service)

Destroy and unregister a service server from its node.

This function will reclaim all associated resources, including the service server itself. Use of a destroyed service server 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 server 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 server is registered.

  • service[in] Service server to be destroyed.

Pre:

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

Pre:

Given service must be a valid service server, 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 service 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 service implementation identifier does not match this implementation, or

Returns:

RMW_RET_ERROR if an unspecified error occurs.