Using B2BITS FIX Antenna C++(tm) user can establish connection with FIX-over-FAST oriented remote site. Also current users are able to migrate from FIX to FIX-over-FAST without significant code modifications.
The following sample demonstrates how to create FIX 5.0 over FIXT 1.1 over FAST session.
#include <iostream> #include <B2BITS_V12.h> using namespace std; int main() { class Appl : public Engine::Application { // See "Application description" section }; try { // initialization Engine::FixEngine::init(); Appl appl; // create a session for FIX 5.0 using FIXT.1.1 as SCP layer over FAST Engine::Session* pSn = Engine::FixEngine::singleton()->createSession( &appl, // pApp "SENDER", // senderCompID "TARGET", // targetCompID Engine::FIX50, // ver - FIX 5.0 application protocol version NULL, // pParam Engine::persistent_storageType, // storageType Engine::FIXT11_FAST_TCP // underlyingProtocolType - create FIXT 1.1 over FAST sublayer ); // ... - business logic // release resources pSn->release(); Engine::FixEngine::destroy(); } catch(const Utils::Exception& ex) { cout << "EXCEPTION: " << ex.what() << endl; } }
// ... - create FIX-over-FAST session Engine::FixT11FastTcpParameters connParams; connParams.host_ = "localhost"; // remote host internet address connParams.port_ = 9999; // remote host TCP port connParams.templateFn_ = "fix50_fixt11_templates.xml"; // path to file with FAST templates for FIX.5.0-FIXT.1.1 protocol. pSn->connect( connParams ); // ... - wait until pSn->getState() != Engine::Session::ESTABLISHED
The following sample demonstrates how to accept incoming FIX-over-FAST connection.
// ... - create FIX-over-FAST session pSn->connect( "fix50_fixt11_templates.xml" // templateFn - path to file with FAST templates for FIX.5.0-FIXT.1.1 protocol. ); // ... - wait until pSn->getState() != Engine::Session::ESTABLISHED
Engine::FIXMessage* msg = Engine::FIXMsgFactory::singleton()->newSkel( Engine::FIX50, "D", Engine::FIXT11 ); // ... - fill message with data pSn->put( msg ); // send message to the remote site msg->release(); // release resources assigned with message
See also: Sending order | Send message | Send message
| FAST type | FIX application type | Comments |
| u32 | i32 | Value must be in range [0, 2^31) |
| u64 | i64 | Value must be in range [0, 2^63) |
| u32 | i64 | Value must be in range [0, 2^32) |
| u64 | u32 | |
| u32 | u64 | Value must be in range [0, 2^32) |
| i32 | u64 | Value must be in range [0, 2^31) |
| i32 | i64 | Value must be in range (-2^31, 2^31) |
| i64 | i32 | |
| u64 | i32 | |
| u32 | char | Value must be in range [0, 2^7) |
| u64 | Engine::UTCTimestampType | Value is serialized/deserialized to u64 using format yyyyMMddhhmmsszzz (i.e. 2008-01-02 03:04:05.678 will be transferred as 20080102030405678) |
| u32 | Engine::LocalMktDateType | Value is serialized/deserialized to u32 using format yyyyMMdd (i.e. 2008-01-02 will be transferred as 20080102) |
| u64 | Engine::LocalMktDateType | Value is serialized/deserialized to u64 using format yyyyMMdd (i.e. 2008-01-02 will be transferred as 20080102) |
| u32 | Engine::UTCTimeOnlyType | Value is serialized/deserialized to u32 using format hhmmsszzz (i.e. 03:04:05.678 will be transferred as 20080102030405678) |
| u64 | Engine::UTCTimeOnlyType | Value is serialized/deserialized to u64 using format hhmmsszzz (i.e. 03:04:05.678 will be transferred as 20080102030405678) |
| u32 | Engine::Decimal | Fractional part of decimal value will be truncated. Value must be in range [0, 2^32) |
| ascii | Engine::Decimal | |
| u64 | Engine::Decimal | Fractional part of decimal value will be truncated. Value must be in range [0, 2^64) |
| i32 | Engine::Decimal | Fractional part of decimal value will be truncated. Value must be in range (-2^31, 2^31) |
| u32 | ascii | Value of string should be an integer in range [0, 2^32) |
| u64 | ascii | Value of string should be an integer in range [0, 2^64) |
| i64 | ascii | Value of string should be an integer in range (-2^64, 2^64) |
| ascii | bool | The value of '\001' will be interpreted as true; otherwise it will be interpreted as false. |
| ascii | char | |
| ascii | i32 | |
| ascii | i64 | |
| i32 | char | |
| u64 | Engine::MonthYearType | Value is serialized/deserialized to u64 using format yyMMdd (i.e. 2008-01-00 will be transferred as 080100)
|
1.5.6