现在市场上用的比较多的是: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.