Search Results for

    Show / Hide Table of Contents

    TSphinxConfig.OnGetClient Event

    OnGetClient event is used to accept and configure client apps dynamically.

    Remarks

    OnGetClient event is intended to be used when your clients are dynamic. When your clients are fixed and static, you can create them directly using the Clients property. For dynamic clients, then OnGetClient is recommended. When the event handler is set, then whenever Sphinx receives a request with any client id, it will not immediately reject it. Instead, it will create a temporary TSphinxClientApp object, and set its ClientId property with the client_id present in the request. It will then check if there is a predefined TSphinxClientApp in the Clients property with the same client id. If a predefined client exists, then it will also fill the properties of the temporary client object with the ones in the predefined client. Then, it will invoke the OnGetClient event handler passing the temporary TSphinxClientApp object in the Client parameter. Also, if the predefine client was found, the value passed to parameter Accept will be true, otherwise false. The event handler is then the opportunity to set more (or all) properties of the TSphinxClientApp object, and to tell Sphinx if it should accept or reject the client, using the Accept parameter. In general, the logic of your OnGetClient event handler should be this: 1. Retrieve the client id from Client.ClientId property 2. Check in your database (or any other place) if the client exists. 3. If it does not exist, set Accept parameter to False. 4. If it does exist, set Accept parameter to True and fill in the properties of the Client object accordingly.

    Syntax

    Unit: Sphinx.Comp.Config

    property TSphinxConfig.OnGetClient: TGetClientEvent

    See also

    • TSphinxConfig
    In This Article
    Back to top TMS Sphinx v1.15
    © 2021 - 2025 tmssoftware.com