DataBasic Reference > Programming in DataBasic > Interprocess Communication

Comment on this topic

Documentation Comments

Use this form to comment on this topic. You can also provide any general observations about the Online Documentation, or request that additional information be added in a future release.

Reality V15.0 ()

Interprocess Communication (DataBasic) (m618705+ipc.htm)

To

Reality

Version

Topic

Submitted by

Company

Location

Email address

Comment

 

 

Interprocess Communication

The following DataBasic statements are used for communication between between client and server programs:

CONNECTExecuted by the client program to establish a connection with a server on a remote system. The parameters required by CONNECT include the identity of the remote system (the name of a ROUTE-FILE entry), the account to use on the remote system, and the name of the server program. The server name must be an executable command in the MDof the named account or the name of a server program which is already running on the remote database or host.

ACCEPTExecuted by a server program, this statement either declares to the local Session Manager the availability of the server to any client which subsequently requests a connection, or establishes a connection to a client which has just requested connection.

Once a session has been started, either the client or the server can send or receive data, or terminate the connection. The following DataBasic statements are used during the session:

SENDSends data to a communicating program.

RECEIVEReceives data sent by a communicating program. Executes the ELSE clause if no data has been sent.

RECWAITAs RECEIVE, but waits for input. The ELSE clause is executed if an error occurs.

DISCONNECTTerminates a session.

Generally, the relationship of two communicating programs at any time is master/slave, with one program suspended at a RECWAIT statement awaiting input. Error codes are returned which allow the programs to detect, for instance, the voluntary (or involuntary) disconnection of the link so that appropriate action can be taken. The master/slave relationship is not tied to the client/server relationship, which has to do with the program initiating the connection rather than the direction of data transmission.

The topic Program Examples using Interprocess Communication contains a number of example IPC programs.

PLIds

A server process which is started by a client process is allocated the PLId of the client process which starts it. The server retains the PLId of its first client or that of the process by which it was pre-started. The PLId of a client can be obtained with the ACCEPT statement, thus enabling the server to provide location-based security or other location-based functionality.

RealityV15.0Comment on this topic