quickfix/quickfix — pull request #6 by blackjack (2013-08-20 10:22:45+00:00)
Title: Current host index method support for SocketInitiator and ThreadedSocketInitiator

Method to get current socket index from socket initiators.
This would be very helpful if e.g. you have different username/password pair for different hosts.
Then you can do something like this:

```c++
void Application::toAdmin(FIX::Message &message, const FIX::SessionID &session)
{
if (message.getHeader().getField( FIX::FIELD::MsgType ) == FIX44::Logon::MsgType()) {
int hostNum = m_initiator->currentHostIndex(session);
if (m_credentials.size() < hostNum+1)
throw FIX::Exception("No user/password for this host");
std::string username = m_credentials[hostNum].login;
std::string password = m_credentials[hostNum].password;
message.getHeader().setField(FIX::Username(username));
message.getHeader().setField(FIX::Password(password));
}
}
```