Previous Topic Next topic Print topic


How the Client/Server Binding Works

When used with CCI, the Client/Server Binding works by having a non­dedicated copy of mfserver running on the server tier; this copy of mfserver communicates with any and all clients using an agreed server name. The mfserver module can be run using its built-in defaults, as its only function is to receive requests from the client to establish or terminate a connection.

The flow of information is explained below (the program files from the demonstration application Csbind are used as example client and server programs):

  1. The user-written client program (netxcli.cbl) performs any application initialization code, prompts the user for the name of a file, checks that the file exists and then calls mfclient.
  2. The first time mfclient is called, it reads configuration information from the configuration file netxdem.cfg.
  3. mfserver receives the connection request.
  4. mfserver spawns a secondary server for each client. The server name is internally generated, based on the name of the initial server with a numeric ID added (for example, mfserver01). Alternatively, you can specify a name in the configuration file.
  5. mfserver sends the secondary server name (mfserver01) back to mfclient and terminates the conversation.
  6. mfclient connects with the secondary server (mfserver01), passing parameters obtained from the configuration file via the LNK-PARAM-BLOCK. For more information see the section The Client/Server Binding Copyfile.
  7. mfserver01 calls the user-written server program (netxserv.cbl), passing the parameters received from mfclient via the Linkage Section.
  8. The first time the user-written server program (netxserv.cbl) is called, it performs any application initialization code, and exits the program. Control is returned to mfserver01.
  9. mfserver01 returns control to mfclient.
  10. mfclient ensures contact has been established and returns control to the user-written client program (netxcli.cbl).
  11. The client program (netxcli.cbl) opens the file specified by the user, reads a record from it and calls mfclient to pass the data via the Linkage Section.
  12. mfclient passes the data to mfserver01 via its internal buffer.
  13. mfserver01 passes the data to the user server program (netxserv.cbl) which creates a file and writes the record to it.

    This read record/write record loop continues until the user-written client program (netxcli.cbl) reaches end-of-file, at which point it closes the file and sends an indication that it is about to terminate to the server. The server responds by sending the name of the directory into which the file was copied.

  14. The client program (netxcli.cbl) displays the name of the file which has been created on the server and calls mfclient with LNK-CNTRL-FLAG set to "client-ending" and then terminates.
  15. mfclient passes the "client-ending" parameter to mfserver01 which passes it to the user-written server program (netxserv.cbl) which terminates itself.
  16. mfclient informs the base server (mfserver), that the secondary server (mfserver01) has terminated.

The process is different when Client/Server Binding is used with AAI. Your application still calls mfclient, but mfclient simply calls aaiclnt, which handles all client-tier interaction with AAI. Client/Server Binding can be used with the full AAI product or the AAI Thin Client. On the server tier, AAI starts an instance of mfserver for each request, and mfserver calls aaisrvr. (AAI can also be configured to invoke aaisrvr directly.) See the AAI documentation for more information.

Previous Topic Next topic Print topic