File Name
Syntax
AppConnection(AppNum: INTEGER)
Parameters
AppNum - position in the connections list of a connection
Returns
Boolean - True if there is a current valid connection
Side Effects
None
Description
If the time has come to reattempt a connection to the application server, that attempt is made. Otherwise, the first network connection that is considered to be valid is returned to the calling procedure. If no other valid connection, retry is set to FALSE. If there is another network connection which is considered to be valid, retry is set to be TRUE.
Dialog Forms Called
None
File Name
Syntax
ClientNetListener
Parameters
ClientData - network listener instance data
Returns
None
Side Effects
None
Description
This is the main client network listener. All application server requests are send through this listener. In general, all messages will be sent from this listener to a request window that is managing the individual request status.
Dialog Forms Called
None
File Name
Syntax
ConnectToServer(ServerName: STRING, PortNum: INTEGER)
Parameters
ServerName - name or IP of server to connect to
PortNum - port on which the dispatcher is listening
Returns
Integer - 1 if success
Side Effects
None
Description
An attempt is made to connect to the application server named in ServerName. If the connect succeeds, this connection is added to a list of available connections the client keeps. The first server in the Connections list is the primary server. All other connections to backup servers, used only in failover mode.
Dialog Forms Called
None
File Name
Syntax
None
Parameters
rw_id - the ID of the corresponding remote_work record
site_id - the tasks destination site
Returns
Database error or 1 for success
Side Effects
None
Description
Creates a remote_task record for the passed-in remote_work at each of the passed-in sites.
Dialog Forms Called
None
File Name
Syntax
DeRegisterServices
Parameters
None
Returns
Integer - 1 if success
Side Effects
None
Description
All server connections are disconnected, and removed from the connectionss list. In addition, the network listeners are halted.
Dialog Forms Called
None
File Name
Syntax
DisconnectFrom AllServers
Parameters
None
Returns
None
Side Effects
None
Description
All server connections are disconnected and removed from the connections list.
Dialog Forms Called
None
File Name
Syntax
ES_RequestRemoteWork(TransactionType: INTEGER, rw_id: INTEGER)
Parameters
TransactionType - indicates the type of work to be done
rw_id - indicates a set of data on which to do the work
Returns
Integer
Side Effects
None
Description
This function is called when TPM has created a RemoteWork entry and needs to invoke an agent to perform the work.
Dialog Forms Called
None
File Name
Syntax
GetAppServerinfo(AppServer, Port, Cookie: STRING)
Parameters
AppServer - application server name
Port - port application server is listening on
Cookie - cookie required to use application server
Returns
None
Side Effects
None
Description
Finds an application server that is valid and returns information on how to connect to it.
Dialog Forms Called
None
File Name
Syntax
GetASDetails(appnum: INTEGER, AppServer: STRING, Port: STRING, apphdl: NETCONNECTION)
Parameters
appnum - indicates which connection to get information for
AppServer - name of the Application Server returned here
Port - port connected on returned here
apphdl - NetCOnnection of connection returned here
Returns
None
Side Effects
None
Description
The connections list is inspected for information about a specific connection named the parameter appnum. The other parameters return data regarding the specified connection.
Dialog Forms Called
None
File Name
Syntax
GetASHandle(appnum: INTEGER, apphdl: NETCONNECTION)
Parameters
appnum - parameter that will return the position in the Connections list of the available Server
apphdl - NetConnection handle of the connection associated with the available Server
Returns
None
Side Effects
None
Description
An available server ID is found, and information regarding how to get to that server ID is passed back through the REF parameters sent in to the routine.
Dialog Forms Called
None
File Name
Syntax
GetClientListenPort
Parameters
None
Returns
Integer - the port number this client is listening on
Side Effects
None
Description
Returns the port number on which the current client is listening.
Dialog Forms Called
None
File Name
Syntax
GetServerInfo(Connected, Disconnected: LIST OF STRING)
Parameters
Connected - list of appnums that are connected
Disconnected - list of appnums that are not connected
Returns
None
Side Effects
None
Description
Gets a list of connected and disconnected servers.
Dialog Forms Called
None
File Name
Syntax
InitNetServices(ParamFile: STRING, DebugMde: BOOLEAN)
Parameters
ParamFile - ini file to store and retrieve settings
DebugMode - if TRUE, log events to a window
Returns
Integer - 1 if success
Side Effects
None
Description
This routine initializes network services. It starts a network listener and gets the application ready to connect to servers. A database connection is required for this to work.
Dialog Forms Called
None
File Name
Syntax
LogEvent(aline: STIRNG)
Parameters
aline - line to write to the log window
Returns
None
Side Effects
None
Description
Writes a line to the debug window.
Dialog Forms Called
None
File Name
Syntax
NDB_InitNetServices(ParamFile: STRING, DebugMde: BOOLEAN, Cookie: STRING)
Parameters
ParamFile - ini file to store and retrieve settings
DebugMode - if TRUE, log events to a window
Cookie - token required by the application server to insure that the server and client are on the same database
Returns
Integer - 1 if success
Side Effects
None
Description
This routine initializes network services. It starts a network listener and gets the application ready to connect to servers. A database connection is not required for this to work.
Dialog Forms Called
None
File Name
Syntax
NetDebugEvent
Parameters
None
Returns
None
Side Effects
None
Description
The event handler for the network debug window. The only thing that this function does beyond the $NullHandler is to reset debug mode upon $MsgClose.
Dialog Forms Called
None
File Name
Syntax
NetSetAppName(NewAppName: STRING)
Parameters
NewAppname - name to use when registering with the server
Returns
None
Side Effects
None
Description
Sets the name that this process registers with on connection to the server.
Dialog Forms Called
None
File Name
Syntax
NetSetuserId(NewUserId: STRING)
Parameters
NewUserId - user ID to use when registering with the server
Returns
None
Side Effects
None
Description
Sets the ID that this process registers with on connection to the server.
Dialog Forms Called
None
File Name
Syntax
PostASynchronous(Request: SERVER_REQUEST)
Parameters
Request - data to be sent to the server
Returns
Integer - 1 if success
Side Effects
None
Description
An asynchronous call that passes data to the server exits. No return data is expected.
Dialog Forms Called
appclnt.dfc[requestwindow]
File Name
Syntax
RequestCallback(VAL whdl: WINDOW, req: SERVER_REQUEST)
Parameters
whdl - the window that is requesting a callback
req - the request structure
Returns
Position in the Connections list of the Server that was
used for the request. If no server was available, -1
is returned.
Side Effects
None
Description
A request for a callback is sent to an application server. If failures to send occur, other connections to servers will be attempted. If no server can accept the message, a failure is returned.
Dialog Forms Called
None
File Name
Syntax
RTBuildError(sProcess: STRING, ProcParmlist: LIST OF STRING, sAction: STRING, ActionParmList: LIST OF STRING
Parameters
sProcess - base message string
ProcParmList - values to be placed in sProcess
sAction - base message string
ActionParmList - values to be placed in sAction
Returns
String - complete string
Side Effects
None
Description
This function is called to construct a message string based on some base strings, and values that are to be substituted as parameters in the string.
Dialog Forms Called
None
File Name
Syntax
RTPostError(errNum: INTEGER, errMsg: STRING
Parameters
errNum - code of message to display
errMsg - error message to display
Returns
None
Side Effects
None
Description
Sends a message to the server that is posted in the control panel.
Dialog Forms Called
None
File Name
Syntax
SendASynchronous(Request: SERVER_REQUEST, hldReq: WINDOW, RetFunction: STRING)
Parameters
Request - data to be sent to the server
hdlReq - the window handle that is waiting to get return data from the server
Returns
INTEGER - 1 if success
Side Effects
None
Description
An asynchronous call that passes data to the server exits. the return data will then be passed to the window handle hdlReq when the server fulfills the request.
Dialog Forms Called
None
File Name
Syntax
SendRequestEvent
Parameters
TheRequest - instance data for the request window
Returns
None
Side Effects
None
Description
This is the request window event handler. It manages each connection that is sent to the application server to see if it gets attention from the server. If the server takes too long on requests, that server is regarded as down, and the request is sent to other servers.
Dialog Forms Called
None
File Name
Syntax
SendSynchronous(Request: SERVER_REQUEST)
Parameters
Request - data to be sent to the server
Returns
SERVER_REQUEST - return data from the server
Side Effects
None
Description
A synchronous call that passes data to the server and returns it to the calling function.
Dialog Forms Called
appclnt.dfc[requestwindow]
File Name
Syntax
SetASDisabled(appnum: INTEGER, NumSeconds: INTEGER)
Parameters
appnum - indicates which connection to disable
NumSeconds - indicates how long to disable the connection
Returns
None
Side Effects
None
Description
This routine disables a connection identified by appnum for a specified number of seconds. If 0 is passed in, the default value (read from the softart.ini file) is used.
Dialog Forms Called
None
File Name
Syntax
SetRequestParentWindow(pwhdl: WINDOW)
Parameters
pwhdl - the window to use as the parent to the request window
Returns
WINDOW - the old request window handle
Side Effects
None
Description
This function sets the window to use as the request parent. When performing a SendSynchronous message, this ensures that the request window is modal to an application dialog box, insuring that it can not be used until the request is complete.
Dialog Forms Called
None
File Name
Syntax
TSD_AppServerConnect
Parameters
None
Returns
None
Side Effects
None
Description
The softart.ini file is read for information on the primary and secondary application servers. The ConnectToServer function is invoked to perform the connect logic.
Dialog Forms Called
None