Xafari Server. Dedicated Mode
This topic describes how to configure application to work with dedicated server. To do this you need to edit config-file, the recompilation of solution is no required.
In this example, one and the same .config file of the application will be used for work client side and the Xafari Server.
Modify the DemoApp.Win.exe.config file as described in Operation Modes (RunCmd.exe) section.
<add key="ValueManagerType" value="Xafari.XafariMultiThreadValueManager`1" />
<add key="Modules" value="DemoApp.Module" />
<add key="UseDedicatedXafariServer" value="True" />
There is the AppModule in the "Modules" key. RunCmd.exe will load this module for its own instance of the application (utility uses its own application class). Thus all the types used by the target application (DemoApp) will be available for the utility. AppModule (in our case it is DemoApp.Module), in turn, will load all other modules, including a FileSearcher module.
UseDedicatedXafariServer key is "True". This means operating in dedicated server mode.
RunCmd.exe placed in the Tools folder of the Xafari Framework installation directory. Copy the utility to the bin directory of the application. To start the server remotely, type in console the following command:
AuthenticationActiveDirectory class is used for authentication in application, therefore, /logon key does not require any additional parameters. The utility will be running on behalf of the current user who is logged on Windows.
/appconfig key specifies the config-file of the target application.
/c StartXafariServer key starts Xafari Server.
With the successful start of the server the following message appears:
Starting Xafari Server... ok
Xafari Server is running... (press Ctrl+C or Ctrl+Break to stop).
The server is ready for use. Now, after the Find Files Action execution, the Message processing will be assigned to a dedicated server. To verify this, stop the server. Now, after the Find Files Action execution, the Messages in the Queue will be in a "Waiting" state until the server will not be started again.