HomeStartingEnvironmentDBMSVisualPQLProceduresSQLFormsHost/APIIndex
Environment homecontents start chapter top of pagebottom of pagenext page index PQLServer

PQLServer

The SIR/XS PQLserver is an executable that allows another standard SIR/XS session to connect as a client and to transmit commands to the server, execute those commands remotely and retrieve output. This is done with a set of PQL functions. The PQLServer must be started to enable clients to communicate to it across the network. The client processes do not require any access to files or databases that are local to the server and the two processes (client/server) may be using different hardware/operating systems e.g. client on windows, server on Unix.

From the client point of view processing is as follows:

e.g.
program
compute client = serlog (0,'TONYDELL:4000','')
write client
compute x = sersend (client,'PROGRAM')
compute x = sersend (client,'WRITE "HELLO WORLD"')
compute x = sersend (client,'END PROGRAM')
compute rc = serexec (client,1)
write 'rc = ' rc
compute olines = serlines(client)
write 'lines ' olines
for i=1,olines
. compute line = serget (client,0)
. write line
rof
compute client = serlog (client,'TONYDELL:4000','')
end program

homecontents start chapter top of pagebottom of pagenext page index

Client Functions when using PQLServer

SERADMIN Various server administration capabilities (returning numeric values)

SERADMIS Various server administration capabilities (returning string values)

SEREXEC Instructs server to execute previously sent commands

SERGET Gets a line of output from server

SERLINES Asks server how many lines of output are left

SERLOG Logs on to the server

SERSEND Sends a string to the server

SERSENDB Sends a buffer to the server

SERTEST Asks server if execution has completed

PQLServer Functions

(These have no effect if used in a program that is not running on the server)
SERNOOUT Suppresses server output

SERWRITE Writes a line of output from server

PQLServer commands

CLEAR SERVER NOOUTPUT
SET SERVER NOOUTPUT
These can be used anywhere in the command stream to control selectively what output is made available for retrieval by the client. SET means that any output directed to standard output is thrown away. If this command is within a PQL program, it affects any compilation listing. Use the SERNOOUT(n) function for execution time control.

homecontents start chapter top of pagebottom of pagenext page index

Running the PQLServer

The PQLserver must be running somewhere on the network to support any VisualPQL client processing. Start the PQLserver by running PQLServer.exe. This starts the server at the default port of 4000 and, in a text window, reports the current IP address. There are a small number of command line options:

PQLServer.EXE
options

Options

SERV = nnnn Specifies a non-standard port that must be an even number - 4000 is standard.
PASSWORD = NAME Specifies a password that allows remote user to administer the server.
LOG Specifies that transmissions are logged to sirserver.log.
UPASS Specifies that only users supplying the password given by PASSWORD=... can log on.

Controlling server locally

To interact with the server, press CTRL-C/CTRL-Break then enter a command:
help Lists these commands.
exit Stops the server immediately.
nologon Stops the server when all clients have logged off. Does not allow any new logins.
logon Reverses a previous nologon and allows normal processing.
list Lists various statistics and the attached clients.
kill n Stops the specified client connection.
Note that the server is not responding to client messages while interacting locally in command mode. Press Enter to allow server continue with normal processing.

Message Log

Messages are all in plain text and have following format:
bytes 1- 4 - overall transmission length in dwrds up to 512
bytes 5- 8 - client id
bytes 9- 12 - message length in dwrds
bytes 13-16 - message type
0 - Logon
1 - SIR/XS Commands / Output lines
2 - Execute
3 - Send output lines
4 - Logoff
5 - Admin
dwrd 3 - n - message text (if applicable)
followed by second message in same format (if applicable) until overall transmission length met.

homecontents start chapter top of pagebottom of pagenext page index