for (;;)
{
if (msgrcv(msqid, &flag, sizeof(struct flags) - sizeof(long), 1, IPC_NOWAIT)>0)
break;
}
msgsnd(msqid, &message , sizeof(struct messages) - sizeof(long), 0);
Is there any accept()
function like in sockets
IPC, but for message queues
IPC?
My server should wait client connection and only when client connected send data back to it.
I special send from client some useless data and check data in infinity loop(that means client is connected, I know that is very stupid algorithm).