Server Mode
QuatView
includes a TCP server mode that provides the capability to communicate
with client programs running on remote computers. The QuatView server can
receive and display a serialized binary data stream of quaternion history data from
any client program that transmits the data in the recognized format. Server mode is
similar to playback mode except that playback mode reads and displays
the
quaternion data from a local file while server mode reads and displays the quaternion
data from a remote computer via a TCP network connection.
Pressing the Listen link will display the Server dialog
as shown in Figure 16. This
dialog allows the user to enable or disable the server. It also allows the user to
specify the server IP address and port, the IO timeout, and a directory for the
optional log file.
IO Timeout
The IO timeout is the amount of time that the server will wait between quaternion
messages before giving up and assuming a bad connection. This timeout only
applies after the first successful quaternion message is received. The QuatView server will wait indefinitely for a client connection, and it will wait indefinitely for the
first message from a connected client. However, after the first message is received,
it will wait no longer than the IO timeout value before subsequent messages. The
default timeout value is 10 seconds. This timeout value can be decreased to as low
as 1 second or increased to any higher value. When the timeout between quaternion
messages is exceeded the server will behave as if it received a stop message from
the client. It will then reset its message counter to zero, close the optional log file,
and then wait again indefinitely to receive another first message from the client.
Log File
The On/Off radio buttons on the Server dialog allow the user to request that a log file
be written to record all of quaternion data received by the Server. The user can
specify the directory for the log file by typing in a directory path or pressing the "Set
Path" link button. The log file itself will be automatically named according to the
following naming convention:
QuatView_YYYYMMDD_HHMMSS.log
where YYYY, MM, and DD are the year, month, and day respectively, and HH, MM,
and SS are the hour minute and second respectively in universal coordinated time.
The log file is formatted as 5 tab-delimited columns with a single header line that
specifies the QuatView version along with the date and time stamp for the file
creation.
Figure 16. Server Dialog
Server Operation
Once server mode has been enabled, the GUI becomes read-only and is ready to
start displaying the quaternion data received from the client application. This means
that no user input is allowed for the Euler angles or the quaternion components since
the quaternion input data will come from the client network stream The conversion
tab is also disabled so that no other GUI input can interfere with the server. Figure
17 shows how the GUI looks in server mode.
The server mode GUI has four new controls at the bottom left that display the server
state, client IP address and port, and a running count of the number of messages
received.
The server state is indicated by the two lights at the lower left. The left light
indicates the connection status and the right light indicates the reception status. If
the connection light is green then an active client connection exists. If the reception
light is green, then the server is actively receiving quaternion messages. The
message format is defined by the QuatMessage class that is included with the client
class library described here.
Figure 17. GUI With Server Mode Enabled