3

I am working with a python implementation of quickfix. http://www.quickfixengine.org

I would like to set SocketConnectHost other than via the configuration '.ini' file, but have not discovered how to do this.

I have discovered that the SessionSettings class has a member SOCKET_CONNECT_HOST, but I don't seem able to 'set' this other than via the '.ini' file.

Nor can I see how to 'get' members individually either.

Printing a string representation of a SessionSettings instance gives a C++ ish reference to a location in memory and...

<quickfix.SessionSettings; proxy of <Swig Object of type 'FIX::SessionSettings' at 0x7f5a1c1333390>.

So it looks like the SessionSettings stuff is being handled in the C++ quickfix engine layer.

Can I get or set just SocketConnectHost from python?

Thanks, Ben

Grant Birchmeier
  • 17,809
  • 11
  • 63
  • 98
abattia
  • 33
  • 5

1 Answers1

0

I can't speak for Python, but there's a SessionSettings instance you need to create a SocketInitiator.

Usually you would create this instance from the QuickFIX configuration file. After initializing it from the configuration file, you can change settings with the setter methods, eg SessionSettings.setString(SessionID s, String key, String value). The key would be SocketConnectHost in your case.

TT.
  • 15,774
  • 6
  • 47
  • 88
  • Many thanks for your suggestion (much appreciated!). In Python too there is indeed a SessionSettings instance (see above), but no setter method along the lines of .setString(), .set() ... at least as far as I can see. – abattia Mar 11 '16 at 15:57
  • @abattia I'm looking at the C++ reference: `const Dictionary & get (const SessionID &) const throw ( ConfigError )`. Maybe get the dictionary for the session, and fiddle with the dictionary? [Reference](http://www.quickfixengine.org/quickfix/doc/html/class_f_i_x_1_1_session_settings.html) – TT. Mar 11 '16 at 16:35
  • @abattia What methods are available on the SessionSettings class you have? – TT. Mar 11 '16 at 16:38
  • SessionSettings has has(self, *args), get(self, *args), set(self, *args), size(self), getSessions(self) apparently ... but set() was not recognized. – abattia Mar 11 '16 at 18:14
  • @abattia Alas I know nothing about python... You don't have some sort of Python API reference for QuickFIX you can consult? I would guess (only a guess) that `get(self, *args)` and passing a `SessionID` for args would give you a `Dictionary`? – TT. Mar 11 '16 at 18:21