Standalone Server Implementations
HydraExpress supports service deployment independent from the Agent. To take advantage of this feature, use the -standalone option when generating code in order to generate a sample standalone server.
For example, this invocation of the code generator for the DayOfWeek example
 
<prompt>rwsfgen -standalone example-project.xml
generates a sample server implementation, DayOfWeekPortServer.cpp in the app\server directory.
The generated sample shows how you could incorporate a HydraExpress service in your application directly, rather than through the Agent. As a result, certain features provided by the Agent are not supported, including multithreading, load balancing, and sessions. However, all the message processing capabilities are present.
The sample server implementation contains a simple main() that loads and initializes named objects, handlers, transports, and listeners, and then starts the listener.
To use the standalone sample server:
1. Configure the listener and other loadable components in the usual way, using their configuration files. The listener’s configuration file is transports.xml.
2. Build your service as usual.
3. Make sure the service library can be found and loaded by the operating system. If needed, you can deploy your service as usual (using deploy target of the generated makefile), or add the service library path to the appropriate system environment path.
4. Start the server by launching its executable and passing the name of the listener as a command line argument.
NOTE: Note: Start the server from your project directory, rather than directly in <projectdir>\bin. This ensures that the server can locate the necessary configuration files at startup.
For example, to use a secure listener, change to your project directory, and enter:
 
Windows: <prompt> bin\DayOfWeekPortServer.exe -t HTTPS
UNIX/Linux: <prompt> ./bin/DayOfWeekPortServer -t HTTPS
If no listener is specified, the HTTP listener is started by default.
5. Run your client by opening another command window, and invoking the client. For HTTP and HTTPS, run the client with the appropriate URL as the command line argument. Note that in the URL, you need to use the port on which the standalone server is listening, as defined in transports.xml.