[ts-general] CentOS 6, Additional database build issue

Paul paul.analytic at gmail.com
Thu Aug 30 06:56:36 EDT 2012


On Tue, Aug 28, 2012 at 01:56:00PM -0700, Harry Balzer wrote:
> 
 . . .
> 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
> #::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
> 
> my understanding's limited, but i'm guessing this can be solved more elegantly
> if anyone has a recommendation.

Harry,

This is the old thread that mentioned IPv4 and IPv6 numbers:
http://www.trading-shim.org/pipermail/ts-general/2009-May/000414.html and
includes a suggestion to try entries of the form "::ffff:127.0.0.1".  Maybe
something like that in TWS and/or .shimrc would constitude a more elegant
solution (I've just tried a few variations, without any success).  

However, this approach seems to work without modifying/removing the IPv6 entries from
/etc/hosts:
1. Add a 'twshost' entry to the 127.0.0.1 line in /etc/hosts:
      127.0.0.1       localhost twshost .....
2. Modify ~/.shimrc accordingly:
      let DbmsHost = localhost,                       
          FeedHost = twshost,         # <----
          ApiLevel = 47; 
3. Specify 127.0.0.1 in the Trusted IP Address section on the TWS API configuration

I suspect the pop-up problem arose because 'localhost' appears in both the
127.0.0.1 entry and the IPv6 ::1 entry (in your /etc/hosts), and for some
reason the latter always gets used. Giving the shim another name to use (e.g.
'twshost') results in the standard IPv4 127.0.0.1 being sent to the TWS.
(Alternatively, maybe just remove 'localhost' from the ::1 line.) Works for me
anyway.

> 
> post fix and tws try, i tried the gateway as well.  some interesting things
> happen when i "show api messages".
> first, tws socket server version is 65, client version is 39.  second,
> EServerSocket terminates conversation with
> client {1}, but for some reason, the api also responds to another attempted
> conversation with client {2} -- also
> terminates.
> 
> i doubt it's as simple as changing the version number somewhere and am not sure
> why the shim tries again after first failing.

The TWS allows multiple clients to connect, including multiple shims (in --data
mode anyway). It seems to try the client ID's in turn until it can connect.
Presumably the shim doesn't know why it's connection attempt failed, so it
tries another client ID (etc, until killed). 

I was looking at src/apis.c and version.h to see if there is a simple change to
make (version numbers etc) but haven't managed to get it working.

Paul


More information about the ts-general mailing list