atmi常用函数列表

上传人:第*** 文档编号:32682575 上传时间:2018-02-12 格式:DOC 页数:10 大小:181KB
返回 下载 相关 举报
atmi常用函数列表_第1页
第1页 / 共10页
atmi常用函数列表_第2页
第2页 / 共10页
atmi常用函数列表_第3页
第3页 / 共10页
atmi常用函数列表_第4页
第4页 / 共10页
atmi常用函数列表_第5页
第5页 / 共10页
点击查看更多>>
资源描述

《atmi常用函数列表》由会员分享,可在线阅读,更多相关《atmi常用函数列表(10页珍藏版)》请在金锄头文库上搜索。

1、内容简介:主要介绍 atmi 函数族中消息,队列,事务,会话相关函数。各族函数不应在同一个层次上嵌套使用。参数都分别要显示指定,若没有,则指定为 0 或 null. 检查和确保参数有效,并且类型匹配。tperrno 和 tperrordetail()分别用获取错误码与详细错误信息。函数列表:For a Task Related to . . . Use This C Function . . . To . . . tpalloc() Create a message buffer tprealloc() Resize a message buffer tptypes() Get a messa

2、ge type and subtype Buffer management tpfree() Free a message buffer tpchkauth() Check whether authentication is required tpinit() Join an application Client membership tpterm() Leave an application tpgetctxt(3c) Retrieve an identifier for the current threads context Multiple application context man

3、agement tpsetctxt(3c) Set the current threads context in a multicontexted process tpsvrinit() Initialize a server tpsvrdone() Terminate a server tpsvrthrinit() Initialize an individual server thread tpsvrthrdone() Termination code for an individual server thread tpreturn() End a service function Ser

4、vice entry and return tpforward() Forward a request tpadvertise() Advertise a service name Dynamic advertisement tpunadvertise() Unadvertise a service name tpgprio() Get the priority of the last request Message priority tpsprio() Set the priority of the next request tpcall() Initiate a synchronous r

5、equest/response to a service tpacall() Initiate an asynchronous request tpgetrply() Receive an asynchronous response Request/response communications tpcancel() Cancel an asynchronous request tpconnect() Begin a conversation with a service tpdiscon() Abnormally terminate a conversation tpsend() Send

6、a message in a conversation Conversational communication tprecv() Receive a message in a conversation tpenqueue(3c) Enqueue a message to a message queue Reliable queuing tpdequeue(3c) Dequeue a message from a message queue Event-based tpnotify() Send an unsolicited message to a client tpbroadcast()

7、Send messages to several clients tpsetunsol() Set unsolicited message call-back tpchkunsol() Check the arrival of unsolicited messages tppost() Post an event message tpsubscribe() Subscribe to event messages communications tpunsubscribe() Unsubscribe to event messages tpbegin() Begin a transaction t

8、pcommit() Commit the current transaction tpabort() Roll back the current transaction tpgetlev() Check whether in transaction mode tpsuspend() Suspend the current transaction Transaction management tpresume() Resume a transaction tpopen(3c) Open a resource manager Resource management tpclose(3c) Clos

9、e a resource manager tpgblktime(3c) Get blocktime value Blocking time management tpsblktime(3c) Set blocktime value in seconds or milliseconds tpkey_open(3c) Open a key handle for digital signature generation, message encryption, or message decryption tpkey_getinfo(3c) Get information associated wit

10、h a key handle tpkey_setinfo(3c) Set optional attributes associated with a key handle tpkey_close(3c) Close a previously opened handle tpsign(3c) Mark a typed message buffer for generation of a digital signature tpseal(3c) Mark a typed message buffer for generation of an encryption envelope tpenvelo

11、pe(3c) Access the digital signature and recipient information associated with a typed message buffer tpexport(3c) Convert a typed message buffer into an exportable, machine-independent (externalized) string representation Security tpimport(3c) Convert an externalized string representation back into

12、a typed message buffer 我们要使用的函数一般情况下需要成对出现:同一端:tpalloc,tpfreetpinit,tptermtpsrvinit,tpsrvdonetpconnect,tpdiscontpenqueue,tpdequeuetpbegin,tpcommittpopen,tpclose两端配合:tpcall,tpreturntpacall,tpgetreply,tpreturntpsend,tprecv关于分配的缓冲区,一般应该谁分配,谁回收。函数使用说明:char*tpalloc(char *type, char *subtype, long size)分配

13、一个缓冲区,供后续的函数使用。返回值:若失败返回空指针,并置 tperrno.int tpinit (TPINIT *tpinfo) 客户端用来加入一个应用,指针值通常为空。可以不显式调用。返回值:若失败返回-1,置 tperrno 和 tpurcode.int tpterm().在客户端程序结束时使用。若出错返回-1 并置 tperrno。inttpsvrinit(int argc, char *argv)由服务端调用,通常在此进行分析命令行参数和打开一个数据库连接 tpopen,供后续循环体中重复利用。 可以不显式调用。返回值: 若失败则返回-1 并且服务不会 被启动。voidtpsvrd

14、one() /* Server termination routine */与初始函数相同,主要在这里关闭数据库连接 tpclose();返回值: 若失败则返回负值,并且服务端被终止。inttpcall(char *svc, char *idata, long ilen, char *odata, long *olen, long flags) char *svc, 交易名称char *idata, tpalloc 分配的缓冲区,用来描述请求,其中的 type,subtype,应和服务端相匹配。long ilen, 对请 求缓冲区的指定( idata) 。对于自定义的类型,FML, FML32

15、, VIEW, VIEW32, X_COMMON, X_C_TYPE, or STRING,可以指定为 0。char *odata, 用 来接收响应的 缓冲区,一定不能为空。也可以和 请求缓冲区共用。long *olen, odata 的长度,一定不能 为空。long flags:TPSIGRSTRT,若被信号中断,此调用重新执行。TPNOBLICK,若请求发送被阻塞(如资源不足,则系统管理员指定的共享资源 ipc 过少, )否则将会一直阻塞,直到超时。TPNOTRAN,当前操作不被当前事务所记录,亦不影响事 务调度。TPNOCHANGE, 当前的输出缓冲区的类型和子类型不能被改变。一般若收到

16、的类型与期望的类型不符,tuxedo 会进行自动类 型转换。tuxedo 系统会自动调整接收缓 冲区的长度。而请求缓冲区不会被自动改变。总是应该检查与使用返回时的指针与长度值。返回值:若失败则返回-1,并置 tperrno.inttpacall(char *svc, char *data, long len, long flags) 返回一个 int,为呼叫描述符,作为 tpgetrply 的参数来收到响应。如果位于事务模式,在提交之前,必须接收到响应,除非 flag 为 TPNORPLY。返回值:若成功返回一个描述符,供 tpgetrply 使用。若失败返回-1 ,并置 tperrno.inttpgetrply(int *cd, char *data, long *len, long flags) cd 为 tpacall 返回的描述符。若 调用成功后,没有数据需要被返回, data 会被置为 0。此调用会阻塞直到超时。返回值: 若失败返回-1,并置 tperrno.inttpsprio(int prio, long flags);

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 中学教育 > 职业教育

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号