SIMPOL Documentation

Chapter 7. The PPCS Server for SBME Databases (PPSR) Component

Contains a server to allow SBME databases to be accessible to a PPCS client. The server is an object which is configured and controlled by SIMPOL

ppcstype1server

Description

A ppcstype1server object provides access to SBME databases to clients using PPCS type 1 over UDP.

Type Tags

None

Object Value

Properties

PropertyTypeDescription
_type(*) This property is provided for use by the user to attach any object of any type to the type in which this property is provided.
__type(*) This property is provided for use by the user to attach any object of any type to the type in which this property is provided. It has the additional feature of being marked with the resolve keyword, so that object resolution can continue down this property.
firstsbmeppcstype1serversbme Specifies the object which represents the first SBME file used by the server.
firstudpportppcstype1serverudpport Specifies the object which represents the first UDP port used by the server.
servingboolean Indicates whether or not the there is currently a pending call to the .serve() method of the ppcstype1server object.
typetype Specifies the ppcstype1server type object.

Methods

addsbme()

Description

Adds an SBME file to the ring of SBME files in use by the server.

Prototype

ppcstype1servervar.addsbme ( string filename, string committype, integer locktimeout, integer cachesize, boolean recordcount, integer codepage, integer error )

Parameters
ParameterDefault valueType nameDescription
filenameNonestring Specified the SBME file to add to the server, by giving its path and name.
committype""string Specifies when changes to the SBME file are to be committed. If this is "" then changes are committed only when the commit method is called for the SBME object. If the committype is "auto" then changes are committed after every change is complete. Committing after every change means that the SBME file is more secure against system or programming errors, but there may be a performance penalty.
locktimeout.infinteger Gives the length of time that a record lock is respected for, measured in microseconds. When a client locks a record (or all records for a table) then that lock must be released by the client within the locktimeout time period. If not then the server will release the lock, and the client may encounter an error if it attempts an operation which assumes that the lock is still in place. A locktimeout of .inf means that the server will never automatically release records locks for tables in the new SBME file.
cachesizePlatform dependentinteger Specifies the amount of memory to reserve for caching for the new SBME file.
recordcount.trueboolean Specifies whether a record count should be performed when the tables are added. If the record count is not done, it will be set to 4294967280 (0xfffffff0). This can be an advantage when sharing very large tables, since the record count may be seldom needed, but the time it takes to calculate it can be 7 minutes or more for large tables (more than 1GB in size).
codepage850integer Specifies the code page to be used for sending and receiving data. The default code page is 850, the DOS Latin 1 code page. Other supported code page values include: 437 (US ASCII), 720 (Arabic), 737 (Greek), 775 (Baltic Rim – Estonian, Lithuanian, and Latvian), 852 (Latin 2 – Eastern European languages), 855 (Cyrillic), 857 (Turkish), 862 (Hebrew), 866 (Cyrillic), 874 Thai, and 1258 (Vietnamese). It is important that the client also be set to open the table using the same code page.
error.nulinteger Specifies an object which is used to output any error code generated during creation of the ppcstype1serversbme object. If error is not specified or is .nul then any error which occurs during object creation will halt the program. If an error object is specified and an error occurs during object creation then the error code is output into that object and the method returns .nul.

addudpport()

Description

Adds a port to the ring of ports in use by the server.

Prototype

ppcstype1servervar.addudpport ( integer udpport, integer txfactor, integer error )

Parameters
ParameterDefault valueType nameDescription
udpportNoneinteger Gives the number of the UDP port which the ppcstype1server object is to start using.
txfactor0integer This value is used to throttle the speed at which packets are sent. The value 0 means no throttling. If a value is specified that is too high to be useful, then the highest most meaningful value will be used.
error.nulinteger Specifies an object which is used to output any error code generated during creation of the ppcstype1serverudpport object. If error is not specified or is .nul then any error which occurs during object creation will halt the program. If an error object is specified and an error occurs during object creation then the error code is output into that object and the method returns .nul.

break()

Description

Breaks out of all pending calls to the server method.

Prototype

ppcstype1servervar.break ()

Parameters

None

serve()

Description

Instructs the ppcstype1server object to process requests from PPCS clients.

Prototype

ppcstype1servervar.serve ( integer timeout, integer error )

Parameters
ParameterDefault valueType nameDescription
timeout0integer Specifies the length of time in microseconds to wait for client requests and process them. If this argument is 0 then the object will process pending requests but not wait for any length of time. If timeout is not 0 then this method will block for the specified length of time, or until it is explicitly broken, by the break method.
error.nulinteger Specifies an object which is used to output any error code generated during the processing of client requests. If error is not specified or is .nul then any error which occurs during object creation will halt the program. If an error object is specified and an error occurs during object creation then the error code is output into that object.