2.4 Closing and Clearing Connections

The client is responsible for detaching connections intelligently. The client can keep a connection active for use by the same or another application. This eliminates the overhead associated with making an actual attachment.

However, if additional resources are required to open a connection to another server, the client/library can determine which connections are no longer needed and which is best to detach. It is very important that every time a connection is opened, it be closed when no longer needed.

A connection handle can be closed by calling NWCCCloseConn.

A connection reference is cleared by following these steps:

  1. Call NWCCGetConnRef to obtain the connection reference to clear.
  2. Pass the connection reference returned from NWCCGetConnRef to NWCCSysCloseConnRef which will clear the specified connection reference.

NWCCSysCloseConnRef forces a server connection detach (used in conjunction with NWCCMakeConnPermanent).

IMPORTANT:Use caution when calling NWCCSysCloseConnRef because other applications on the workstation might be using the connection.