ct_con_drop

Description

Deallocate a CS_CONNECTION structure.

Syntax

CS_RETCODE ct_con_drop(connection)
CS_CONNECTION    *connection;

Parameters

connection

A pointer to a CS_CONNECTION structure. A CS_CONNECTION structure contains information about a particular client/server connection.

Returns

ct_con_drop returns the following values:

Return value

Meaning

CS_SUCCEED

The routine completed successfully.

CS_FAIL

The routine failed.

CS_BUSY

An asynchronous operation is already pending for this connection. See “Asynchronous programming”.

The most common reason for a ct_con_drop failure is that the connection is still open.

Examples

Example 1

        /* ex_con_cleanup() */
        CS_RETCODE CS_PUBLIC
         ex_con_cleanup(connection, status)
         CS_CONNECTION             *connection;
         CS_RETCODE                status;
         {
             CS_RETCODE    retcode;
             CS_INT        close_option;
            /* Close connection */
             ...CODE DELETED.....
            retcode = ct_con_drop(connection);
             if (retcode != CS_SUCCEED)
             {
                 ex_error("ex_con_cleanup: ct_con_drop()
                     failed");
                 return retcode;
             }
            return retcode;
         }

This code excerpt is from the exutils.c example program.

Usage

See also

ct_con_alloc, ct_close, ct_connect, ct_con_props