I have an application where i launched a process (using QProcess) , from this process i need to send a message to parent process.
from parent
int msgid = msgget(0x1234,IPC_CREAT|0666);
char str[50];
qDebug() << "waiting for msg ";
msgrcv(msgid,str,sizeof str,0,0);
if (!strcmp(str,"sender")){
/*do some processing */
}
int msgid = msgget(0x1234,IPC_CREAT|0666);
char str[50];
qDebug() << "waiting for msg ";
msgrcv(msgid,str,sizeof str,0,0);
if (!strcmp(str,"sender")){
/*do some processing */
}
To copy to clipboard, switch view to plain text mode
from the child
int msgid = msgget(0x1234,IPC_CREAT|0666);
char str[]="sender";
qDebug() << "sending for msg ";
msgsnd(msgid,str,strlen(str)+1,0);
int msgid = msgget(0x1234,IPC_CREAT|0666);
char str[]="sender";
qDebug() << "sending for msg ";
msgsnd(msgid,str,strlen(str)+1,0);
To copy to clipboard, switch view to plain text mode
i am getting a msg "waiting for msg" and system is going to hang. what is the problem?
how else will pass msg from one process to other.
Thanks.
Bookmarks