Note: The synchronous server mode is obsolete now. Use the asynchronous mode instead.
The single-stream server mode allows the user to move control to a local IP port, an IP port on a remote hosto or to stdin,
SPECTRA reads commands from a tcp/ip port (or stdin) and replies with done, error or a value that has been prompted. A client ends a server session by sending the string bye.
In a server sesssion the function yesno() always returns 0, noyes() always 1.
If the qualifier /verbose is supplied, ONLINE displays the messages that are exchanged.
The qualifier /restart directs ONLINE to re-open the socket, if the client terminated the session by a socket-close. This option is intended to be used while a client is debugged. A BYE exits the server mode, independent of /restart.
The qualifier /eos=ichar allows the specification of an end-of-string character for outgoing messages.
The server mode is a general network interface to
SPECTRA/ONLINE. It has been implemented to serve those users
who run electronical equipment with own computers.
They have to write a client that communicates with an ONLINE
process.
An example client is in
the distibution (client.c), see .
1. Example:
Serving a local port
ONLINE> server/verbose 7777
The following commands are issued on a remote host
telnet online-host 7777
*=energy()
energy() = 8980
move/mult=(mot1=11,mot2=12)
* = gmup( mot1)
The function gmup() returns the position of a motor. The meaning of the other command should be obvious.
2. Example:
Serving a local port by starting ONLINE from a shell prompt:
# spectra -online -s -p7777
ONLINE enters the server mode immediately, without first passing
control to the user. It is not recommended to invoke the server mode
this way because error messages, that may pop-up during the program
start, are ignored.