### The ds_unbind( ) Function Call

The ds_unbind( ) call terminates a directory session and makes the session parameter unavailable for use with other interface functions. However, the unbound session can be modified by OM functions and used again as a parameter to ds_bind( ). When the session parameter is no longer needed, it should be deleted by using OM functions such as om_delete( ).

The following code fragment from example.c shows how the application closes the connection to the GDS server by using ds_unbind( ):

/* Close the connection to the GDS server. */

if (ds_unbind(bound_session) != DS_SUCCESS)

printf("ds_unbind() error\n");

The ds_unbind( ) call corresponds to the DirectoryUnbind function in the Abstract Service defined in the X.500 standard.

###