Session Object
Description
The Session object provides access to the state and properties that exist for the current connection or session.
Syntax
Remarks
CRT's Session object is accessed through the top-level objectÆs æSessionÆ property.
Session Object Properties and Methods
ááááConnected |
ááááConnect |
ááááLocalAddress |
ááááDisconnect |
ááááLogFileName |
ááá Log |
ááááRemoteAddress |
ááááPrint |
Description
Returns a boolean value indicating whether the current session is connected or not.
Syntax
Remarks
Boolean read-only property.
Description
Returns the IP address of the local machine in the form of a string.
Syntax
Remarks
LocalAddress is a read-only string property. The LocalAddress property should only be accessed if the session is connected. Attempting to access LocalAddress while not connected is an error.
Description
Returns or sets the name of the current log file.
Syntax
Remarks
If filename is invalid a runtime error is generated. See also: session.Log
Description
Returns the IP address of the remote host in the form of a string.
Syntax
Remarks
RemoteAddress is a read-only string property. The RemoteAddress property should only be accessed if the session is connected. Attempting to access RemoteAddress while not connected is an error.
Description
Connects a session
Syntax
Remarks
The Connect method takes a string parameter that specifies how a connection is to be made. The format of the string parameter matches the format of the command line arguments to CRT.
Examples:
Connect using a pre-defined session:
Connect to æmyhostÆ on port 2345 using the telnet protocol and Default session parameters:
Description
Disconnects the current session.
Syntax
Remarks
If the current session is not connected. Disconnect does nothing.
Description
Enables or disables logging.
Syntax
Remarks
Starts or stops logging depending on the boolean state of the æstartÆ parameter. When logging is being started the optional boolean æappendÆ and ærawÆ parameters may be set to True to open the log file for appending or to log raw characters respectively. The append and raw parameters are optional and are false if not specified (When æstartÆ is false the values of append and raw are ignored).
Description
Starts or stops autoprint.
Syntax
Remarks
Starts or stops autoprint depending on the boolean æstartÆ parameter.