API分类

现在市场上用的比较多的是:OMNet API和OMex API。

OMnet Purpose:

OMnet has two major purposes:

1.为可信源提供OMex中心系统的验证交易。
2. To distribute market information efficiently.

OMnet Functionality
1. Login functionality
OMnet handles each user’s access to and rights within the OMex system (as setup in the CDB).
Each user can only access the system from one terminal at a time – multiple access is not possible for security reasons.


2. Limitations
OMnet limits the access to the RTR network. OMnet serves as an interface between OMex client applications and RTR.


3. Distribution
OMnet distributes the broadcasts.


2.3.2 Transactions and Broadcasts Definition

An accepted transaction is either a successful message or a question from a client to a server with a corresponding reply. 

A broadcast is information from a server to one or more clients.

3.7 Transaction Identification

3.7.1 The OMnet Transaction Identification


The omniapi_tx_ex() and omniapi_query_ex() routines return the transaction identification. It is an eight-byte data structure that uniquely identifies a transaction (in native endian).


3.7.2 The OMex Order Identification


The order identification (an eight-byte data structure) uniquely identifies an order. It is returned from omniapi_tx_ex() and omniapi_query_ex() calls (in native endian).
Central applications use it to identify orders and requests. It is also used for later references to an order or a request.

API Call Timeout :

An environment variable, OAPI_TIMEOUT, specifies the timeout. It should not be set to a lower value than the CDB transaction timeout value. The default value is 300 seconds. The environment variable is picked up by the OMnet API library through the C-function getenv(..).

3.10 Binary Logging

It is possible to enable trace of data being sent between the API and OMnet Gateway process by enabling the binary logfile functionality. With trace enabled, selected data will be written to a file, which can be examined to see which information that has actually been sent and received by the API client. Each API session that connects with the API is given a dedicated trace logfile, which contains data for that session only. The exchange has an application for displaying the contents of a binary logfile.

3.10.1 Logged Function Calls
Following calls are traced completely:
• Send a transaction
• Send a query and its reply
• Set event
• Read event, when at least one broadcast or event is fetched
• Clear event
• Get info

5.2.2 omni.h
This file defines the OMnet environment that is used by both the OMnet API application and an OMnet Gateway. This file holds the fundamental type definitions for writing portable C applications.
5.2.3 omnifact.h
This header file defines all standard facility and event types. The numbers, starting from 70, are recommendations, but may be altered by the OMnet operator/configurer.
5.2.4 omex.h
This file is exchange specific. It is not delivered within the API kit. It has to be obtained from the exchange. The omex.h file contains structures for transactions and queries used in the exchange system. Exchange-specific error codes are also defined in omex.h.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值