ham_disconnect(), ham_disconnect_nd(), ham_disconnect_node()

Disconnect from the HAM

Synopsis:

#include <ha/ham.h>

int ham_disconnect( unsigned flags);
int ham_disconnect_nd( int nd, unsigned flags);
int ham_disconnect_node( const char *nodename, unsigned flags);


Arguments:

flags
Currently not used.
nd
(ham_disconnect_nd() only) The node identifier of the targeted remote node.
nodename
(ham_disconnect_node() only) The targeted remote HAM.

Library:

libham

Description:

The ham_disconnect() function closes a previously open connection to a HAM. The ham_disconnect_nd() and ham_disconnect_node() functions close previously opened connections to remote HAMs.

The nd specified to ham_disconnect_nd is the node identifier of the remote node at the time the ham_disconnect_nd() call is made.

Note: Since node identifiers are transient objects, you should obtain the value for nd immediately before the call, using netmgr_strtond() or another function that converts nodenames into node identifiers.

The ham_disconnect_node() function takes as a parameter a fully qualified node name (FQNN).

Because the library maintains a reference count, the actual connection to the HAM is released only when the number of calls made to ham_disconnect() matches the number of calls previously made to ham_connect().

When a process calls ham_connect() and then calls fork(), the connection is no longer valid in the child process. To reconnect to the HAM, the child process must call either:

There are no flags defined at this time.

Returns:

0
Success.
-1
An error occurred (errno is set).

Errors:

EINVAL
There's no valid connection to the HAM to disconnect.

Classification:

QNX Neutrino

Safety:  
Cancellation point No
Interrupt handler No
Signal handler No
Thread Yes