The QMConnectPool() function establishes a QMClient session using connection pooling.
The function arguments are:
|Host||is the IP address or name of the server system. Use of IPV6 addresses requires that the QMConnectionType() function is used first to enabled IPV6 support.|
|Port||is the port number to which connection is to be made. Set this to -1 to use the default QMClient port.|
|UserName||is the user name under which the server process is to run.|
|Password||is the password for the given UserName.|
|Account||is the name of the QM account to be accessed.|
|Pool||is the connection pool name.|
The QMConnectPool() function attempts to establish a QMClient process on the system identified by the Host argument. If successful, the function returns True. If unsuccessful, the function returns False and the QMError() function can be used to retrieve a text error message identifying the cause of the failure. If there is an idle QMClient process that matches the user, account and pool names, the function connects to this session rather than creating a new one.
A single client may open multiple connections simultaneously. For the C and VB.Net variants of QMClient, the internal session number associated with the session opened by QMConnectPool() can be retrieved using QMGetSession(). All subsequent QMClient function calls relate to the most recently opened session unless QMSetSession() is used to select an alternative session. For the QMBasic class module, Java and Python variants of QMClient, each session is instantiated as a separate object.
QMClient sessions run the MASTER.LOGIN and/or LOGIN paragraph (if present). A QMClient session can be recognised within these paragraphs by testing the value of @TTY which will be "vbsrvr" for QMClient. Note that a prompt for input within the actions performed by the paragraph cannot be handled via QMClient.
int QMConnectPool(char * Host, int Port, char * UserName, char * Password, char * Account, char * Pool)
if (!QMConnectPool(Host, -1, UserName, Password, Account, Pool))
printf("Failed to connect - %s\n", QMError());
QMConnectPool(ByVal Host as String, ByVal Port as Integer, ByVal UserName as String, ByVal Password as String, ByVal Account as String, ByVal Pool as String) as Boolean
If Not QMConnectPool(Host, -1, UserName, Password, Account, Pool) Then
MsgBox(QMError(), MsgBoxStyle.Exclamation, "Failed to connect")
Bool session->ConnectPool(Host, Port, UserName, Password, Account, Pool)
session = object("!qmclient")
if not(session->ConnectPool(Host, -1, UserName, Password, Account, Pool)) then
stop "Failed to connect - " : session->error()
boolean ConnectPool(String Host, int Port, String UserName, String Password, String Account, String Pool)
if (!qm.ConnectPool(Host, -1, UserName, Password, Account, Pool))
System.out.println("Failed to connect - " + qm.Error());
ConnectPool(Host, Port, UserName, Password, Account, Pool)
if not qm.ConnectPool(Host, -1, UserName, Password, Account, Pool):
print("Failed to connect - ", qm.Error())
Connection pooling, QMDisconnect, QMPoolIdle()