When a client no longer needs any message services, it should call the cmc_logoff function to end the CMC session that it established with the cmc_logon function. Depending on the nature of your client and whether it is possible to establish a CMC session without the user's assistance, it can be practical to close the session as soon as a group of messaging calls are finished. For other clients it is practical to establish one CMC session when the client starts and retain it until the client exits.