Dwarf Server Framework
1.3.1
Sample Applications
Content
Overview
Sample applications can be used either to test the server functionality after
the fresh installation, or just to learn by playing with the sample XML-based
configuration files. You can use the sample configuration also as a template
for your own application.
Installation
The "conf/samples/dwarf/" subdirectory of the Dwarf installation
contains several nested subdirectories with configuration files required by
the particular sample applications. An application can be run by executing one
of the "run.bat" or "run.sh" scripts from
the Dwarf installation root with an URL of the application's main configuration
file as the command-line argument. These files are typically named "main.xml".
Applications
Each sample application has the corresponding "conf/samples/dwarf/xxxxx"
subdirectory, which contains the application-specific configuration files.
Simple Network Services
Subdirectory: conf/samples/dwarf/rfc/
This sample application provides some simple TCP-based services, namely:
- Echo (RFC862)
- Discard (RFC863)
- Character Generator (RFC864)
- Quote of the Day (RFC865)
- Daytime (RFC867)
Trying out:
- Run the sample application with the "run.bat" command
on Windows or "run.sh" command on Unix systems. Use the
"conf/samples/dwarf/rfc/main.xml" as the only script argument.
If you get the "Out of environment space" error message on Windows 9x, try
the "run98.bat" instead.
- Use telnet and connect to 127.0.0.1 port 7 to see if the application is
working properly. It should echo all your lines entered into the terminal
window until you close the connection. This is because the port 7 is assigned
to the Echo Service. Additional ports can be examined in the same way for
the Discard Service (port 9), Daytime Service (port 13), Quote of the Day
Service (port 17) and Character Generator Service (port 19).
- Press Enter at the command prompt while the server is running
to get into the server management console. The help command will
show you a list of the available commands. The shutdown command will
cause the application to exit.
Network Server Tutorial
Subdirectory: conf/samples/dwarf/quote/
This sample application is covered in details by the Network
Server Tutorial.
Console Command Tutorial
Subdirectory: conf/samples/dwarf/cmd/
This sample application is covered in details by the Console
Command Tutorial.
Password Encryption Command
Subdirectory: conf/samples/dwarf/pwd/
This is a minimal application with just one special console command for interactive
encrypting of user passwords. This command can be used to encrypt a plaintext
password using an arbitrary algorithm before it is written to a password file.
Trying out:
- Run the sample application with the "run.bat" command
on Windows or "run.sh" command on Unix systems. Use the
"conf/samples/dwarf/pwd/main.xml" string as the only script
argument. If you get the "Out of environment space" error message on Windows
9x, try the "run98.bat" instead.
- Press Enter at the command prompt to get into the server management
console. The help command will show you a list of the available commands.
The passwd command accepts either one or two arguments - a single
argument represents a password to be encrypted. An optional second argument
must be a full class name of a PasswordEncoder
implementation. The command encrypts the given string with the default (or
specified) algorithm and prints it out to the system console. Refer to the
API documentation for more information about the PasswdCmd
and the supported encryption mechanism.
Return to the main page.
Copyright (c) 1999-2005, Gnome Ltd. All rights reserved.