典型应用
Application application;
FIX::FileStoreFactory storeFactory( settings );
FIX::ScreenLogFactory logFactory( settings );
initiator = new FIX::SocketInitiator( application, storeFactory, settings, logFactory );
initiator->start();
application.run();
initiator->stop();
delete initiator;
源码分析
- 组成
class SessionSettings
typedef std::map < SessionID, Dictionary > Dictionaries;
Dictionaries m_settings;
class SocketInitiator : public Initiator, SocketConnector::Strategy
SocketInitiator( Application&, MessageStoreFactory&,const SessionSettings&, LogFactory& ) EXCEPT ( ConfigError );
DataDictionary.cpp
Field.cpp
FieldMap.cpp
Message.cpp
Http.cpp
Socket.cpp
Session.cpp
- 新建线程
initiator->start();
HttpServer::startGlobal( m_settings );
HttpServer::onStart()
m_pServer->block( *this )
select( FD_SETSIZE, &readSet, &writeSet, &exceptSet, getTimeval(poll, timeout) );
processWriteSet( strategy, writeSet );
processReadSet( strategy, readSet );
thread_spawn( &startThread, this, m_threadid )
SocketInitiator::onStart()
Initiator::connect()
SocketInitiator::doConnect( const SessionID& s, const Dictionary& d )
m_connector.connect( address, port, m_noDelay, m_sendBufSize, m_rcvBufSize, sourceAddress, sourcePort );
while ( !isStopped() ) {
m_connector.block( *this, false, 1.0 );
onTimeout( m_connector );
}
- 线程任务分布
FIX::Session::sendToTarget
FIX::Session::sendRaw
FIX::Session::send
FIX::SocketConnection::send
FIX::SocketConnection::processQueue
QuickFIX Engine Web Interface
FIX::Initiator::startThread
FIX::SocketInitiator::onStart
FIX::SocketConnector::block
FIX::SocketMonitor::block
FIX::SocketMonitor::processWriteSet
FIX::SocketInitiator::onConnect
FIX::SocketConnection::onTimeout
FIX::Session::next
FIX::Session::generateLogon
FIX::Session::sendRaw
FIX::Session::send
FIX::SocketConnection::send
FIX::SocketConnection::processQueue
FIX::Session::generateHeartbeat
FIX::Session::generateLogout
FIX::Initiator::startThread
FIX::SocketInitiator::onStart
FIX::SocketConnector::block
FIX::SocketMonitor::block
FIX::SocketMonitor::processReadSet
FIX::ConnectorWrapper::onEvent
FIX::SocketConnection::read
FIX::SocketConnection::readMessages
FIX::Session::next
FIX::Session::verify
Application::fromApp
FIX::MessageCracker::crack
FIX42::MessageCracker::crack
Application::onMessage