CPI-C [for IBM]

Source: Internet
Author: User

The common programming interface for communications

Introducing CPI-C

This is a brief overview of the common programming interface for communications (CPI-C), giving basic information about its purpose, the rationale for its development, some idea of how to use it in applications, and a summary of the advantages (and trade-offs) of CPI-C as an interface for communications.

CPI-C, pronounced sip-Ik, provides a straightforward method for developing portable distributed applications. The advantages of portability between SS platforms and limits of application development maximize the value of CPI-C and the usability of CPI-C applications.

APPC: The function behind CPI-C

Advanced program to program communications (APPC) is an implementation of IBM's SNA Lu 6.2 communications architecture. an application programming interface (API) is provided for programs to access the functions of APPC. using this API, one program can maintain a conversation with another and exchange information between ss a network. the program issues APPC commands, called verbs, in the format designated by the programming interface. this interface also defines the format of the values that are returned to the program.

As APPC was developed, distinct APIs for the numerous platforms emerged. each API had unique characteristics and its own format for requesting the functions that APPC provides. this complicated the development of distributed applications in a general sense because the application had to be tailored to meet the demands of a special environment. the need for a standard API that cocould be utilized on any platform was soon evident.

CPI-C was developed to avoid platform dependencies. although the actual implementation of CPI-C over APPC may vary from platform to platform, the API is consistent. consequently, platform-dependent details need not be considered in the development of applications using CPI-C.

For more information, see the education resources listed on the previous page.

Appn: The network behind CPI-C

Advanced peer-to-peer networking (Appn) is one of the preferred network choices for CPI-C applications. CPI-C applications also run over OSI Networks, and, with technology such as anynet, can run over TCP/IP networks as well.

For more information, see the education resources listed on the previous page.

Advantages of CPI-C

platform independence points to one of CPI-C's main advantages- simplicity . A Distributed Application Developer can utilize CPI-C without needing specific knowledge of how the interface is implemented on a particle platform. the syntax of APPC APIs varies among environments. some APIs are verb control block structures while others are function CILS. furthermore, the actual appc api verb names are unique for each environment. consequently, it requires specific knowledge of the participating platform API to implement a non-CPI-C distributed application. in contrast, A CPI-C application can be developed for any environment based only on a general knowledge of CPI-C since the syntax and structure is standard.

PortabilityIt is a second advantage of using CPI-C. since the programming interface to APPC using CPI-C is consistent platform SS platforms, an application developed for a special platform can be moved to another environment and run every tively. for example, an OS/2 application which uses standard CPI-C functions can be linked with the appropriate VM CPI-C library and run in the VM environment with no changes to the source code.

A significant feature of CPI-C is that it can communicate with a partner program that is written using either a platform-dependent API or CPI-C. the programming interface being used is transparent to the conversation and to the Partner Program.

Programming with CPI-C

The syntax of CPI-C is straightforward and lacks the complexities common with your platform-dependent APIs. Function callare used with the particle conversation values passed as parameters.

There is only one set of function CILS with CPI-C regardless of the conversation type. this is a further benefit of CPI-C when compared to some platform-dependent APIs. in some platform-dependent APIs, a different set of verbs is used for a mapped conversation than is used for a basic conversation. with CPI-C, mapped is used as the default conversation type unless specifically indicated otherwise using CPI-C's set conversation type (cmsct) Call.

The general format to invoke a CPI-C function is:

 
Call routine_name (parameters, return_code ).

Following are the six CPI-C Starter set CALS:

 
Cminit-Initialize conversation, cmaccp-accept conversation, cmallc-allocate, cmsend-send data, cmrcv-receive, and cmdeal-deallocate.

As an example, to accomplish the send data function in CPI-C using the C programming language, the cmsend function must be called with the appropriate parameters. some of these parameters contain values assigned by the Program (input parameters) and others are assigned values by CPI-C as a result of the function execution (output parameters ).

 
Cmsend (conversation_id,/* input */buffer,/* input */& send_length,/* input */& request_to_send_received,/* output */& return_code ); /* output */

The input parameters are values which must be specified before the CPI-C function is called. The primary CPI-C input parameter is the conversation ID.

The conversation ID is a unique identifier assigned to a conversation as a result of the cminit (at the originator) or cmaccp (at the target) Call. the conversation ID is an input to each succeeding CPI-C call to specify the appropriate conversation.

The partner is specified:

    • A partner logical unit (PLU) name indicating with whom the conversation shocould be established,
    • A mode name indicating the type of session to be used for the conversation, and
    • A transaction Program (TP) name indicating the transaction program to be started on the partner's computer as a result of this conversation.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.