[ts-gen] Hooking into shim directly via C/C++
Ken Feng
kfmfe04 at gmail.com
Wed Aug 26 20:05:50 EDT 2009
Hi Nils,
I am glad to hear that you were able to get this to work!
Would you care to share your code/invocations or at least show us some
pseudo-code of what you did? Did you popen() and then fork() your
process? What did you do to resynchronize the two processes, if you
needed to wait for a process to complete?
Any hints would be greatly appreciated.
- Ken
On 8/27/09, Nils Gebhardt <mail at ngebhardt.de> wrote:
>
>
>
> On Wed, 2009-08-26 at 17:28 +0900, Ken Feng wrote:
>
>
>> So I tried rewriting what little Ruby code there was in C/C++,
>> thinking it would be a little work, but really shouldn't be that
>> bad... ...until I looked up popen() to replace Ruby's IO.popen(). It
>> appears that the call is at such a low level that only one direction
>> (read or write) can be opened at a time. To do bi-directional piping,
>> I have to fork() and do all sorts of not-so-fun-stuff.
>
> I am not really familiar with ruby, so I came also to the C popen call,
> stumbling on the same point with reads/writes. Now I have a single
> small C program doing nothing else than reading from a named pipe,
> writing to a shim process which is open (and kept constantly open) in a
> popen call, which in turn writes to a log in the file system. That
> allows me to read and write from others programs asynchronously to/from
> shim while still recieving asynchronously messages from tws like order
> status messages, what I find sufficient.
>
> regards
>
> Nils
>
> _______________________________________________
> ts-general mailing list
> ts-general at trading-shim.org
> http://www.trading-shim.org/mailman/listinfo/ts-general
>
More information about the ts-general
mailing list