Building Distributed
Applications
Using the Progress AppServer
Establishing a Connection with the CONNECT( ) Method
The CONNECT( ) method takes up to four CHARACTER arguments in the following order, all of which are optional, depending on the configuration of your AppServer environment:
The connection-parameters argument is used to locate an AppServer that supports the required business function.
The userid, password, and appserver-info arguments are passed from the client application to the AppServer, which passes them to the Connect procedure (if defined). If a Connect procedure is not defined for the connected AppServer, these arguments are discarded. The requirement to specify these arguments depends entirely on the AppServer application.
An AppServer can reject a connection request either because the Connect procedure failed or because there are not enough system resources (for example, Application Server processes) available to service the connection.
The rest of this section describes these parameters in greater detail.
Connection Parameters Argument
The connection-parameters argument specifies a comma-separated list of parameters necessary to establish the AppServer connection. Table 5–2 describes the AppServer connection parameters that you can include in this list.
Table 5–2: AppServer Connection Parameters Connection Parameter1 Description -AppService application-service The name of an Application Service supported by the specified NameServer. (Defaults to the default service for the specified NameServer.) -H [ host_name | IP-address ] The network address of the NameServer machine. You can specify either the TCP/IP host name or the Internet protocol address of the machine. (Defaults tolocalhost
.) -S [ udp-service-name | port-number ] The port number for the NameServer connection. You can specify either an explicit UDP port number or a UDP service name. If you use a UDP service name, the method uses the port number associated with that name in the TCP/IP services file. (Defaults to 5162) -pf filename A text file containing any of the other AppServer connection parameters described in this table. If this file contains any other Progress startup parameters, the method ignores them.
Note that the actual AppServer that the client connects to is controlled by the NameServer based on the Application Service (-AppService) name specified by the client. The Progress interface in co-operation with the NameServer connect the client application to one of the AppServer instances that supports the specified Application Service. If you do not specify an Application Service, the NameServer uses whatever AppServer registers itself as the default service, if any. For more information on load balancing, see the information on NameServers and load balancing in "Overview of the Progress AppServer," and Administration."
If the Application Service is unknown to the NameServer, the client application receives an error. Otherwise, the connection proceeds and any configured Connect procedure executes for the connected AppServer.
For more information on Application Services and NameServers, see Overview of the Progress AppServer."
Application Arguments
The userid, password, and appserver-info arguments are optional. However, the requirement to specify these arguments, and to provide specific values for any of them, depends on whether the AppServer Connect procedure is being used on the AppServer you are connecting.
If the AppServer Connect procedure is defined for the AppServer, then you must know how the AppServer Connect procedure is implemented to determine how to specify these values. If you do not specify a value for an argument, the unknown value (?) is passed to the AppServer Connect procedure for that argument. Progress only passes these values from the CONNECT( ) method to the AppServer Connect procedure. It is the procedure that actually evaluates the values that are passed.
If the AppServer Connect procedure is not defined for the AppServer, you do not need to pass the three application arguments to the CONNECT( ) method. If you happen to provide them, they are ignored.
For more information on Connect procedures, see Programming the AppServer."
NOTE: When determining what arguments to pass to the CONNECT( ) method, understand that an AppServer accepts a connection request only if any configured Connect procedure executes successfully.
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |