2 Server

A server application manages connections to clients. The server is not visible for users, only for system administrators.

The system administrator should take care of the server program, its settings, maintenance and guarding its availability within the network. An ordinary user probably never deals with the server program itself, the server program will only be used to connect to.

The server shares some settings with connected clients if necessary, effectively hiding them for users at client side. These settings appear as read-only at client-side and can only be modified server-side.
Note that most settings are given a sensible value at startup, mostly the server will run perfectly without touching these settings at all. Settings like Organization settings can be modified to suit the needs of your organization.

An easy way to see the server working is to run the client/server demo. For more information please refer to Appendix E: Client/server demo.

2.1 Basics

2.1.1 When to use a server

The client/server version was designed to use the software with multiple computers, at schools. This version has various advantages compared to the standalone version:

  • The client/server version offers the powerful feature of groupsessions. This will give a group of students managed access to the software. This can be very useful, for example if you have only a few computers in a classroom and all students need to use them in turn.
  • The client/server version also saves all data on the server, all clients have access to this data.
  • The client/server version provides more security through authorization, this prevents students from editing settings and viewing results from others.

To use these features you need to configure and maintain a server with user accounts. However, this is not a tedious task. Once configured to your liking the server will run on its own, without any human attention.

2.1.2 How it works

As the name says, the client/server version uses the client-server model. This means that clients are 'ignorant' and retrieve all data from a central server. This allows clients to log in from multiple locations and also allows multiple clients to work with the same data.

The good news that as a user of this program, you don't really need to know how this exactly works, because the program does it all for you. All you need to do is install a server and run it, and then run a client to connect to this server.

Read more about the basics of the client-server model here: here or visit the Wikipedia entry: in English, Dutch, Spanish or Portuguese.

2.1.3 Port number

The communication between the server and the client is handled by protocol based on TCP/IP. The client needs to provide the address (or IP) of the server and the port number to connect. The server will use (listen on) port number 51482 by default. For most users, this will be sufficient.

If you want to choose a custom port number, you should use a number between 49152 and 65535. Visit the website of IANA for more information.

2.2 Networking Server side

2.2.1 Installation

The server will run on any Windows-platform. It is recommended to use a machine that already has a server function within your organization, but this is not required.
Connecting clients need to be able to communicate with the machine the server program is running on (using TCP/IP). Be aware of domain/workgroup restrictions, firewalls and any other security restriction, if present. Anyone of these restrictions can disable communication traffic without notice, so this is the first place to look if things don't work. Also, don't forget to check your hardware on both sides (are cables plugged, are network cards working properly).

If a firewall is causing trouble, you could use port number 80. This is the HTTP-port and most firewalls accept HTTP-traffic. The downside is that with port 80 in use it is impossible to run an HTTP-server on the machine the server program is running.

The installation of the server will be pretty straightforward when you use the setup.
Note that the parameter -server is used when calling the executable, this will tell the program to start as a server.

Warning: The server will take full control of the folder it is running from, the so-called 'root'-folder. It will create a subfolder UserData to put files in and delete them. To prevent problems it is strongly recommended to install the server program in a new folder.

Usually only the System Administrator will install the server program or change settings at the server side. You should protect the server program against access by unauthorized users.

2.2.2 Managing the server

The server starts listening automatically when you start the program. It is possible to stop the server and leave the program running. You will need to do this to change some Server settings.
Most settings cannot be modified when the server is active.

Document your settings for later recovery.

The server will do several checks when starting up. It will also perform cleanup of files and build a database with files present (see File management).

It is possible to run the program without ever considering the technical details. However, it will probably pay off to consider the settings at the server side, especially if you have a large number of users.

The client side is designed for the 'dumb' user, so that everyone should be able to use the network without ever being faced with networking and/or management issues.
The server manages all settings to facilitate this and will inform all clients automatically about these settings, if needed.

2.2.3 Server activities

The server is not a visual tool. It has been designed to be present in the network running alone, no user is needed to control its actions.

If the server really needs attention, the server will send messages to the clients log or even go into 'Error'-status. Mostly the server will get back to normal automatically after the error is fixed.

Obviously, one important task of the server is to facilitate connections with clients. When a client connects and during the lifetime of this connection the client and the server will exchange information. This happens mainly invisible for the user. For performance and stability reasons exchanging this information is optimized and not real-time. Information at client-side could therefore be out of sync, generally up to about 20 seconds, but if the server is busy it could be more. If you think some information is 'old' or not available at all you could try to refresh, for instance by reopening the function you are using. If it's still not good, wait and be patient, updates will arrive in due time.

Unlike HTTP, connections will be kept until the client application closes. This is easier to implement and also facilitates stability and security of the connections. The downside is that each client connection will put some load on the server, each connection will eat up some memory serverside. If you have many connections the memory usage of the server might be considerable.

Besides the TCP-server, the server also hosts a fileserver. Since data-storage is file-based, the fileserver handles all read and write requests from clients. The fileserver also maintains a database of files available to clients and performs cleanup and free space checks.

2.2.4 Server status

The server monitors its own health, this is reflected in its status. If the server is 'active' all communication actions can be performed without delay, but if the server is busy or even in error, actions might be postponed or cancelled, to ensure stability of the server.

All clients will be notified of the current server status. To avoid flickering updates will not always be sent immediately.


StatusDescription
Unknown
You should never see this status.
Initializing
During startup the server will have this status.
Active
The server is listening for new clients, no restrictions apply.
Busy
This is a normal situation, but lower priority actions will be delayed or declined, in order to give the server some air.
Sessions will still be possible in this status.
Error
If an error occurs almost all client activity will be frozen. Clients will be blocked as if they were disconnected from the server. Idle clients will be shutdown.
Sessions can be finished normally, but starting a new session is not possible.

The server sends a text message to connected clients about the nature of the error. You might need to consult the logging of the client to obtain this information.

It depends on the nature of the error if the server can recover automatically. You will need to access the server program and consult its logging if it doesn't.


Possible causes are:
  • The server is too busy. The server (thinks it) cannot handle everything it is asked to do in a properly and timely fashion.
    The server should return to a normal status pretty soon after this. This situation is rather a preventive measure than a real error. Note that if this happens too often it will adversely influence performance and stability of the server.
  • The harddisk of the server is full. The server will only recover after it has detected that enough space (at least 30 MB) is available on the drive the server program is using. The server warns if the drive is getting full. You should pay attention to these warnings to avoid this error.
  • The system time was changed.
    The system time is important for the server program. The program can only assume the systemtime is set correctly when started. This is important, e.g. to determine the age of files, in order to decide to delete them or not. You should never change the system time when the server program is active.

Maintenance
The server runs in a single thread, this means it can only do one thing at a time. If the server is busy other things will be left to wait. The maintenance status indicates that the server is doing things taking an unknown amount of time and probably quite some time (more than a few seconds). During maintenance the server cannot respond properly to client requests, so clients will postpone almost all actions and wait for the server to become available again.

2.2.5 Connection status
Besides the server status the server also maintains a connection status. This status specifies actions to take client side when the maximum connection limit is reached or when the server is shutting down.


StatusDescription
Available
New client connections are accepted normally.
Filling up
As Available, but the number of clients has exceeded iMaxConnections x fPercCriticalConnections, in other words, the server is getting close the maximum number of connections it accepts. Clients with status 'idle' will be shutdown until the number of clients drops below
iMaxConnections * fPercCriticalConnections.
Maximum connections
The server cannot accept more connections because the maximum number is reached or exceeded. Some connections (up to fPercPendingConnections x iMaxConnections) will be left to wait, otherwise they will be forced to shutdown.
Shutting down
Indicates that the server is in the process of shutdown (see below).

2.2.6 Shutting down

Shutting down the server is straightforward, but you should exercise caution not to disrupt the work of connected clients when you do this. Best is to plan the shutdown and warn connected users beforehand, if possible.

If you stop the server it will start a controlled shutdown procedure: it waits for clients until they can safely be closed. All idle and available clients will be shutdown automatically, but users clientside get a 60-second grace period to override the server-initiated shutdown. Clients still have full access to the server, they are only more or less kindly requested to close the client application. Note that clients will not always respond immediately, but wait a short random time - this ensures stability, the server will not get lots of clients disconnecting at the same time.

The process is relatively slow, depending on the number of connections. Although you can cancel the wait and shutdown immediately, this is not recommended and only provided in case you get stuck with a connected 'ghost' client, but this rarely happens. Generally, you should leave the process and wait, it has been automated for your convenience so that no one loses data or gets an unexpected disconnect.
The server stops when there are no more clients connected.

Note: While it is possible to cancel the shutdown procedure of the server, it is not possible to recall clients already in the process of shutdown.

2.2.7 Organization

Organization settings can only be set server-side, if the server is not active. If the server is active, it will inform all connecting clients about the current organization settings. Client users can only view these settings read-only.

Note: The standalone program also uses the organization rules, but logically they will only be valid for the single machine the program is running on.

The server will inform all connecting clients about the regional/locale format settings it has serverside. These settings are Windows-based set things like the date format (is it day/month/year or month/day/year etc) and settings like the currency symbol. The client will use the settings it receives from the server, overriding the local (Windows) settings. This way all connecting clients are using the same regional/locale format settings.

Warning: Organization settings should be considered well before implementing them. Making changes later on might be difficult, as this will affect the way your organization uses the program and the server needs to be restarted for this. It is also recommended to document your settings for recovery purposes.

Please refer to Appendix D: Organization for more information.

2.3 Server settings

Most server settings can only be modified if the server is not active. If you want to change a setting you'll need to stop the server first and then open the Network settings.

2.3.1 Server

Server settings

The server will bind to the IP specified and will listen on the assigned port number. The default port number is 51482.

Audit policy

The server can audit client activity, i.e. track activities for security purposes. Individual clients can be suspended if they violate a maximum number activities in a given time-span.


Audit categoryAllowance factor (per min)
Failed logon
0.6
Successful logon
1  
File privilege violation
1  
Normal group/student event
1.4
Successful special group operation
1
Failed special group operation
0.6
Suspension
0

2.3.2 Statistics

Status
Displays the actual server status and connection status.

Communication
Displays the actual values of data traffic (in # of messages). Some of these values are used to monitor the health of the server (see below).

2.3.3 Connected clients

This page provides an overview of clients currently connected. A detailed report will be compiled if you click the Textreport-button.
It is also possible to lift a client's suspension manually (serverside only).

2.3.4 Accounts

In order to gain access to the server, users will need to logon. This is not only for better security, but it also enables you to organize your users and their data.

Warning: You will need to define at least 1 enabled account, otherwise clients will never be able to log on to the server.

It is optional to create demo-accounts during the installation of the program. These accounts are intended to demonstrate various account-types and should be deleted before you implement the program into your organization.

Basically, every account is identified by a username, and (internally) by an id-number.
An account account can be protected by a password, but passwordless accounts are also possible. As of version 4, no password length is enforced. (Version 3 required at least 6 characters).

Domain
A domain specifies a physical file location and a description. An account is always member of a domain, and each account associated with the domain will use the file location and bear the description of the domain.

Creating domains in a smart way makes it possible (if desired) to separate classes, buildings, curricular years, schooltypes, and so on, while they are accessing the same server.

Domains also allow teachers to view only their own students.

Foldername
Indicates the folder location, in ..\UserData\<folder>. This folder will be used as the data folder for this domain.

Description
The description will be displayed clientside. It should be short and informational (like Grade 7 2012/2013).
Descriptions should start with a capital character.

Account
This page specifies the details of the user and its credentials for this particular account. An account gives a user access to the server. Within the same domain you can create several accounts, but with different privileges. This gives you control of how your users are accessing the client application.

Username
Must be unique.

Password
A password is required for accounts with teacher privileges or higher. Passwords are case-sensitive.

Account privileges
The program recognizes three levels of access, each having a predefined set of privileges:

Access levelDescription
Student
The user has only basic access to the program and will only be able to do a session.
Teacher
As Student, but can also view the results of all students of his own domain. Is allowed to modify all files within the domain.
Administrator
As Teacher, but is allowed to view files of all domains.

Availability
Enable or disable the account here.

Domain (of this account)
Specifies the domain this account belongs to.

  • Regular account
    Select a single domain to assign this account to. The account becomes a member of this domain.
  • Multiple-domain account
    Select two or more accounts to assign this account to. The account can be a member of one the selected domains. The user needs to select a domain when logging on. This feature can be useful for teachers working in more than 1 domain.

Note: Accounts are designed to authorize users, not to authenticate them. So don't give each student an individual username/password combination but let them log on with a passwordless account instead.

Important: The username and domain of an account cannot be changed afterwards.

Textreport
You can compile a textreport of all accounts defined. The progam will prompt to include passwords or not in this report. Note that the information will be saved as a plaintext-report on the harddisk.

2.3.5 Filemanagement

The server has no database, all data is stored in separate files. The server maintains these files and can delete them too, the idea behind this is auto-cleanup and saving diskspace. This is enabled by default.

The server recognizes two categories: Configuration files and Report files.

Configuration files
Configuration files are considered to be more important. These files include tasks (.cfs), problemlists (.prl), studentlists (.csv or .stl) and active groupsessions (.gps).

Reportfiles
Report files are generally files generated automatically by the program. Report files are session reports (.ses), completed groupsessions (.gpf) and log files (.log).

Note: Files with other extensions are not maintained by the fileserver, they will be ignored.

File management settings
Listed in the table below are the default settings for file management. If one of these limits is exceeded the server will delete files beginning with the oldest one, until none of the limits are exceeded, so be careful.
Note that these values were changed in version 3.0.5. With the current default settings only a maximum number of files will be enforced.


Default fileserver parametersConfiguration filesReportfiles
Enforce maximum file count
Yes
Yes
Maximum file count (#)
2500
5000
Enforce maximum file age
No
No
Maximum file age (days)
365
90
Enforce total size of all files
No
No
Maximum size of all files (MB)
50
100

Manual actions
The server keeps and updates a list of files in memory. If you place a file manually this list needs to be updated before clients can see the new file. Use the button Refresh filelist in this case to do update the filelist.
The button Cleanup files forces the server to cleanup the files now. Normally this is done automatically once a day.

2.3.6 Maintenance

Close clients remotely
Use the button Close now to close clients remotely. It is safe to close inactive clients, this will close idle clients only. Closing All clients will simply close clients regardless the status. This may disturb users using with the software.

Advanced parameters
As the name implies, these parameters are advanced - this means you should only modify these if you understand what they mean. Normally, there should be no need to change these parameters,  only if you have to deal with many connections or heavy network traffic. Even then you should be cautious and stick to fine tuning of the default values.

Because you normally do not need to modify these values you will have to edit the .ini-file and restart the server after that.


ParameterDescription
Client parameters
The following parameters are defined serverside and sent to every client upon connection.
bDoSwitchToIdleStatus
[ boolean ]
Default value: 1
Allowed values: 0 or 1
- If 1 the client will go to idle status after the time interval has elapsed
iTimeSwitchToIdleStatusSecs
[ seconds ]
Default value: 600
Minimum value: 30
- Time interval in seconds before an available (unused) client switches to idle
Server parameters
Advanced server parameters are designed to support the stability of the server, by monitoring and controlling the maximum connection count and the message flow.
iMaxConnections
[ clients ]
Default value: 100
Minimum value: 1
Maximum value: 1000 (by no means a guaranteed performance, just a safety limit)
- Maximum number of clients that can get a valid connection to the server.
Note that the next 4 values are percentages, not absolute numbers. However, if iMaxConnections is 100 (as it is by default), the percentage values are equal to the corresponding absolute numbers. So if the 4 parameters are set to default these can be explained as follows (all values are examples):
- Up to 130 (=130% of 100) clients can be connected (30 are waiting).
- If there are 100 clients, 10 idle clients - if present - will be shutdown. 90 clients will be left undisturbed, even if they are idle.
- At 170 clients connected (this means 40 are illegal) we reach the point that we say 'server is busy'.
- At 200 clients connected the server is 'too busy'.
fPercPendingConnections
[ percentage ]
Default value: 130
Minimum value: 100
- Percentage of maximum clients allowed to wait when the maximum is reached, others will be shutdown. Can be interpreted as '130% (default) of iMaxConnections clients are allowed to be connected to the server'.
fPercCriticalConnections
[ percentage ]
Default value: 90
Minimum value: 5
Maximum value: 100
- Percentage of maximum clients that will be persistent, others in idle status will be shutdown (specified by bDoSwitchToIdleStatus).
fPercTooManyConnections
[ percentage ]
Default value: 200
Minimum value: 120
- Defines the maximum clients the server will accept lowlevel. New connections will be disconnected immediately, without notification of the reason.
Note on messages: In this program messages can be around a 100 bytes to 60K in size. Messages for operating purposes are small, data messages are obviously bigger. The average of the messagesize will probably be a few K. The number of messages is useful to show how busy the server is, since all messages will involve some work to be done by the server. This depends on your hardware: CPU capacity, memory and networkspeed need to be ... in order to be able to send all these messages. It also depends on the number of clients you want to allow to connect. Generally, the more clients connected, the more messages are send.
By adjusting the message rate limits you can tune the server program. Don't set these values too tight, as the server might be unjustly 'busy' forever.
Use with caution.
iCommHighMessagesPerMinute
[ messages per minute ]
Default value: 3000
Minimum value: 500
- Messages per minutes rate (total of in+out) indicating server is busy. The value of this setting depends on both the server- and the networking hardware (see note).
Use this parameter to optimize performance of the server.
iCommTooHighMessagesPerMinute
[ messages per minute ]
Default value: 9000
Minimum value: 1000
- Messages per minutes rate (total of in+out) indicating server is too busy. This will set the server into 'Error' status. The value of this setting depends on both the server- and the networkhardware (see note).
Please note that if this limit is crossed too often it will adversely influence performance and stability of the server.
You should use this parameter to set a limit value for messages transfer and iCommHighMessagesPerMinute to optimize performance of the server .
iUpdateFileListFromDiskIntervalSecs
[ seconds ]
Default value: 900
Minimum value: 60
Maximum value: 86400 (1 day)
- Interval in seconds indicating an update of the file administration. The file list will be updated reading the harddisk of the server. During this process the server status will be set to 'busy'. After updating all clients will receive an updated file list.

2.3.7 Log
This page shows the latest log entries. Loglines are automatically flushed to files, the server will overwrite the oldest files with the newest loglines.

© Copyright 2006-2021 by Hendrik Jan Runhaar