Profile Picture

Start/Stop plugin and plugin's instance

Posted By gbulle 8 Years Ago
Message
Posted Monday April 27 2009
When I click  "Live options" button I load succesfully my plugin and I init all my subsystems

(prices and orders)

When I click "Start live system" it appear that RightEdgesystem create  a new istance of the plugin

How to start the plugin only once clicking "Live options" or "Start Live system" but being sure to not create another istance?

Thanks

GB

Posted Tuesday April 28 2009
RightEdge will create a seperate instance of a plugin for the live data retrieval and the broker functions.  There's not currently a way to avoid this- they are created in seperate AppDomains.  The ServiceConnectOptions passed to the IService.Connect() method will let your plugin know whether it will be used for data retrieval or broker functions, if you need to have different logic depending on this.

Thanks,
Daniel

Posted Tuesday April 28 2009
So there is no true difference if I create one dll with broker/datafeed functions

or two separated dll (one for broker, one for prices) .

I am investigating a problem I see  when running the second istance:

 I see a typical app domain error like this  Cannot pass a GCHandle across AppDomains

(I use FIX libraries based on C++);

so I  want to understand the overall process to fix this issue

TX

Bye

GB

Posted Tuesday April 28 2009
Yes, you're correct. It can be together or separate.

I'm not sure where "Cannot pass a GCHandle across AppDomains" is coming from. I don't see that in our list of errors produced.

gbulle (4/28/2009)
So there is no truedifference if I create one dll with broker/datafeed functions

or two separated dll (one for broker, one for prices) .

I am investigating a problem I see when running the second istance:

I see a typical app domain error like thisCannot pass a GCHandle across AppDomains

(I use FIX libraries based on C++);

so I want to understand the overall process to fix this issue

TX

Bye

GB
Posted Tuesday April 28 2009
 "Cannot pass a GCHandle across AppDomains"

is not a problem of yours.. it is fix engine.....

it appear that the low level C++ DLL functions do not know from which appdomain

have been invoked....

I am investigating but not a simple question.... if you have any idea.....

probably  I have to run the low level DLL as "isolated" so that each appdomain has one copy of the DLL... but not sure....

 

TX

GB

 

Posted Tuesday April 28 2009
RightEdge load all DLLs of the Plugin directory into GAC.

I have copied in the plugin directory two low level DLLs and RightEdge as usual load these DLLs

into GAC.

What to do if  I want to not load these DLL into GAC because I want that the broker plugin use one instance of the DLL and the datafeed plugin use another istance?

May be I have to generate two versions of the same DLLs and link one plugin to version 1.0 and another plugin to version 1.1?

Have you another suggestion?

Tx

Bye

GB

Posted Tuesday April 28 2009
The other option is to have an intermediary process that serves as a proxy. The plugins communicate with the proxy and and proxy has one instance of the FIX DLLs loaded. This would involve a bit of work because you'd have to build a transport layer (probably sockets) to make the calls between the plugin and proxy.

gbulle (4/28/2009)
RightEdge load all DLLs of the Plugin directory into GAC.

I have copied in the plugin directory two low level DLLs and RightEdge as usual load these DLLs

into GAC.

What to do if I want to not load these DLL into GAC because I want that the broker plugin use one instance of the DLL and the datafeed plugin use another istance?

May be I have to generate two versions of the same DLLs and link one plugin to version 1.0 and another plugin to version 1.1?

Have you another suggestion?

Tx

Bye

GB
Posted Wednesday April 29 2009
Hi

The initialitation process for FIX protocols is not very fast (request to open a session,

send of username/password, heartbit etc etc); only when this phase is over is possible

to subscribe to market data or send orders. I have added  init functions

into INITIALIZE function of the plugin

When my init phase is completing I raise several events; one of these event say "init phase over"

How to enter your CONNECT function only when my event "init phase over"  has been raised?

TX

Bye

GB

Posted Wednesday April 29 2009
Hmm. Well, Connect is the first thing that's called, so there really isn't anyway to hook into your FIX initialization before that. Is the FIX initialize asynchronous? If so, use a ManualResetEvent object inside of the Connect function so that it waits until the initialize is complete before returning.

Does that help?

gbulle (4/29/2009)
Hi

The initialitation process for FIX protocols is not very fast (request to open a session,

send of username/password, heartbit etc etc); only when this phase is over is possible

to subscribe to market data or send orders. I have added init functions

into INITIALIZE function of the plugin

When my init phase is completing I raise several events; one of these event say "init phase over"

How to enter your CONNECT function only whenmy event "init phase over" has been raised?

TX

Bye

GB


Similar Topics


Reading This Topic


2005-2017 © RightEdge Systems