I have a Photon sub-process spawned by the main process(not a photon
application), I need to transfer data between the main process and the
photon process.
My program is simplified to be:
Myprog.cpp:
main()
{
chid = ChannelCreate( 0 );
coid = ConnectAttach( 0, 0, chid, _NTO_SIDE_CHANEL, 0);
spawn(NO_WAIT, “Myphoton”, “Myphoton”, chid, NULL);
MsgSend(coid, &msg_send, sz1, &msg_rcv, sz2);
}
MyPhoton.c:
void input_proc( void *data, int rcvid, void *msg, size_t msglen )
{
SetResource;
MsgReply(rcvid, &msg_return, size);
return Pt_CONTINUE;
}
main()
{
coid = ConnectAttach(chid);
PhAppAddInput(0, getppid(), input_pro, msg);
PtMainLoop();
}
It seems that the main process can not talk with the photon process.
Does any one has sone idea on interprocess communication like this?
Thanks for any help. I am working under QNX6.2NC.