Set or retrieve the sessionKey value.
HostConnection.sessionKey
Arguments
HostConnection
Required. HostConnection object.
Remarks
READWRITE.
A sessionKey is a unique value identifying the session.
The sessionKey property needs to be set before attempting to reconnect to an existing session.
Two types of session keys are available:
1. | A numeric session key. The values begin at 1 and go up to the total license amount. |
2. | A number + "_" + random text and numbers. The value of the number begins at 1 and goes up to the total license amount. |
Type 2 enforces the rule that sessions may not be mistakenly used by a second user (e.g. when the first user's session has timed out).
Use the Admin Console to configure the type of session key to use (Unique Identifier String or Simple Integer).
The following example demonstrates how to use a single connection object to manage multiple sessions:
HostConnection oConn = new HostConnection();
oConn.sessionHost = "127.0.0.1";
oConn.sessionPort = 23;
oConn.sessionOptions = "ConnectTestRow:23;ConnectTestColumn:2;ConnectTestText:ENTER;";
oConn.sessionType = "TN3270";
// make the first connection
oConn.connect("standard");
string sessionKey = oConn.sessionKey;
oConn.disconnect("reserve");
// make a second connection
oConn.connect("standard");
string sessionKey2 = oConn.sessionKey;
oConn.disconnect("reserve");
// close first session
oConn.sessionKey = sessionKey;
oConn.connect("standard");
oConn.disconnect("stop");
// close second session
oConn.sessionKey = sessionKey2;
oConn.connect("standard");
oConn.disconnect("stop");
Requirements
Inventu Viewer+
See Also
Connect | Disconnect | sessionOptions | sessionMonitor
Applies To: HostConnection object
© 2022 Inventu Corporation