Top  Previous  Next


The QMGetSession() function returns the internal session number associated with the currently selected QMClient session.


In the C or VB.Net versions of QMClient, a single client may open multiple server connections, each identified by a session number. The QMConnect(), QMConnectLocal() and QMConnectPool() functions select an available session number to use for the newly created session which can be retrieved using QMGetSession(). All subsequent QMClient function calls relate to this session until an alternative session is selected using QMSetSession() or a new connection is opened.


The QMGetSession() function has no equivalent in the other variants of the QMClient API as each session is managed as a separate instantiation of the object.


The examples below save the current session number into a variable named OldSesNum, open a new connection (which will create a new session), perform some processing, disconnect the new session and then use QMSetSession to revert to the original session.







See also: