6 13 LceEndSession

LANSA Open Guide

6.13 LceEndSession

Ends the specified session with the host.

BOOL

LceEndSession

(int 

iSession,

 

 

 BOOL

fResume )

  

Parameters

iSession

The session identifier as returned by LceGetSessionId.

fResume

Close or keep the conversation open. Refer to Notes.

  

Return Values

TRUE is returned if the session has ended successfully.

FALSE is returned if an error occurs.

Notes

If fResume is set to TRUE, all the session information is de-allocated but the communications conversation is kept active. The given session identifier remains valid. The TRUE option allows the session to be opened again later with different fields, files etc., but without allocating another conversation.

If fResume is set to FALSE, then the session is ended and the communications conversation is de-allocated. At some point in your application, this function should always be called with fResume set to FALSE for every session opened, even if it has already been called with fResume set to TRUE.

Failure to terminate the session may result in a communications resource overhead on the host.

If you do not end the opened sessions, they may remain open on the host until they are terminated manually. When you are building and testing your applications, you must be careful to terminate sessions on the host which were not closed properly. For example, if your PC application fails and an LceEndSession was not executed, you may have to remember to terminate the session on the host manually.