On 20. Feb 2012, at 22:58, cpapado [via Software] wrote:

> Thanks for the very speedy responses Stefan! I think I'm close to figuring 
> this out. 

You're good in picking up the crumbs I throw in your direction.

> 1. Define two co::packet subclasses ClientRequestInitData and 
> ClientRespondInitData. The second class will have an additional field to 
> carry the initData id in. The command IDs for the two packet types will be 
> CMD_CLIENT_CUSTOM and CMD_CLIENT_CUSTOM+1 respectively. 

Use co::NodePackets base classes for the right packet type. Both carry the 
requestID in addition.

> 2. Extend the QT application to derive from RequestHandler().

Your LocalNode has the RequestHandler. Best is if you subclass LocalNode and do 
the stuff there.

> Register a commandHandler by calling registerCommand( 
> fabric::CMD_CLIENT_CUSTOM + 1, ClientFunc(this, &_handler, 
> localNodeCommandQueue)) in the QT app constructor.

Yes.

> 3. Extend the client application by adding a command handler for 
> CMD_CLIENT_CUSTOM packets. This handler just creates and sends a 
> ClientRespondInitData packet back to the Qt app (with the initDataID filed 
> populated and the requestId field being the same as the requestId of the 
> incoming ClientRequestInitData packet).

Yes.

> After connecting to collage, the QT app will create a request, a 
> ClientRequestInitData packet and stick the requestID in it. It will send the 
> packet to the remote node and then it will call waitRequest(requestID). The 
> remote client node will handle the request and send back the 
> ClientRespondInitData packet with the initDataID and the same requestID. As I 
> understand it, during this time the QT node is blocked on waitRequest(). When 
> the ClientRespondInitData packet reaches the QT app, it will call the 
> registered handler for CMD_CLIENT_CUSTOM+1 commands. Inside the handler I can 
> populate a member fielding the app state with the initdataID and use it later 
> for whatever I want. 

Correct on all points. You can also pass back the init id in serveRequest() to 
waitRequest() instead of using a member variable.


> Are there any immediate concerns, particularly w.r.t. threading that I should 
> be on the lookout for? 

Just handle both commands in the command thread (queue).


Cheers & good luck,

Stefan.



--
View this message in context: 
http://software.1713.n2.nabble.com/Affecting-Collage-objects-outside-an-Equalizer-application-tp7301888p7303894.html
Sent from the Equalizer - Parallel Rendering mailing list archive at Nabble.com.

_______________________________________________
eq-dev mailing list
[email protected]
http://www.equalizergraphics.com/cgi-bin/mailman/listinfo/eq-dev
http://www.equalizergraphics.com

Reply via email to