设为首页 收藏本站
查看: 763|回复: 0

[经验分享] CPI-C [For IBM]

[复制链接]
累计签到:1 天
连续签到:1 天
发表于 2015-10-3 13:03:13 | 显示全部楼层 |阅读模式
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 across platforms and ease 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 across 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 particular environment. The need for a standard API that could 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 particular platform. The syntax of APPC APIs varies among environments. Some APIs are verb control block structures while others are function calls. Furthermore, the actual APPC API verb names are unique for each environment. Consequently, it requires specific knowledge of the particular 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.

  Portability is a second advantage of using CPI-C. Since the programming interface to APPC using CPI-C is consistent across platforms, an application developed for a particular platform can be moved to another environment and run effectively. 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 many platform-dependent APIs. Function calls are used with particular conversation values passed as parameters.

  There is only one set of function calls 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 calls:      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 by:

  • a partner logical unit (PLU) name indicating with whom the conversation should 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.

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-122143-1-1.html 上篇帖子: IBM AppScan使用随想 下篇帖子: IBM本本常识,答记者问
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表