TTMSMCPServer.TryGetSessionValue Method
Reads a string value stored against the session whose request is being handled on the calling thread.
API unit family: TMS.MCP.Server
Declaring type: TTMSMCPServer
Inherited from: TTMSMCPCustomServer
Overloads
Overload 1
Reads a string value stored against the session whose request is being handled on the calling thread.
function TryGetSessionValue(const AKey: string; out AValue: string): Boolean; overload;
Parameters
| Name | Description |
|---|---|
AKey |
Key to look up. |
AValue |
Receives the stored value, or an empty string when the lookup fails. |
Returns
True when the value was found; False outside a request, on a transport without sessions, or when the key is absent.
Overload 2
Reads a string value stored against a specific session, regardless of which request is being handled.
function TryGetSessionValue(const ASessionId, AKey: string; out AValue: string): Boolean; overload;
Parameters
| Name | Description |
|---|---|
ASessionId |
Identifier of the session to read from. |
AKey |
Key to look up. |
AValue |
Receives the stored value, or an empty string when the lookup fails. |
Returns
True when the value was found; False when the identifier is empty or unknown, or the key is absent.