Hi, I am trying to send/receive data by message queue and expecting it to be blocked on send/read for other side (at least this is my understooding ) , I am connecting message between perl<->C , perl is working as expected , but in C msgsnd and msgrcv are not waiting (blocked) untill second side will read/write .
Here is a code I am using :
QueueId = msgget(QueueKey, 0777 | IPC_CREAT | IPC_EXCL );
if ((status=msgsnd(QueueId, &MsgBuf, s.length()+1, 0)) == -1) { /* +1 for '\0' */
fprintf(stderr,"Failing to send a message: \"%s\"...\n",s.c_str()),
msgctl(QueueId, IPC_RMID, NULL);
exit(-1);
};
msgrcv(QueueId, &MsgBuf, sizeof(MsgBuf.mtext), 0, 0);
Let me to describe a problem more precised :
I am expectin to open the message in other process in perl ,it should get a data from C->msgsnd and reply back to C-msgrcv.
I am expecting from C->msgsnd to be blocked untill perl will make msgrcv
and C->msgrcv to be blocked untill perl side will execute Perl->msgsnd .
However I don't run Perl at all and C->msgsnd should be stacked forever ...
However it execute msgsnd and msgread with previously send data without waiting ...