[K3d-development] IPC between K3ds
Brought to you by:
barche
From: <jo...@my...> - 2007-01-04 20:20:08
|
Hi everyone! (Happy new year too :D) I am trying to make IPC between two k3d instances, and i was searching opinions and ideas. The main idea is adding the capability of linking to a node of another k3d instance. (I suppose this is not done yet :) ) Protocol or format ------------------ Let's say I want to get a Mesh output from other k3d instance. I have two options: 1-Use a intermediate data Mesh format to do the IPC. (throught sockets or shared memory) 2-Place the C++ object on Shared Memory and read from it. For 1: I can use the serialization API to write the intermediate format. But i dont know if it is too slow. It can be used between different machines. For 2: a- I have to overload the "new" operator. isnt it? b- To make it work right i should place the C++ object in the same address in both programs. Am I right? b1- Or, if I can't, i will have to reinterpret the pointers... (which is something i exactly dont know how) It can not be used between different machines, but its fast. IPC events ---------- I suppose this would be the question: How can i attach a property to a listening socket? Lets suppose we have two k3d instances: A and B A writes the data. B reads the data. So B should be sleeping on a socket waiting (but not freezing the program, could be a thread?) for to A to send an event. When B recieves an event it synchronizes the data and generates a signal for the connected node. Then something like m_mesh.changed_signal().connect( make_reset_mesh_slot() ); should work. Cheers, Joaquín. |