I have a socket and a message queue over which i am trying to multiplex input using select().
When data comes over socket the select works but when it comes over message queue the select is not detecting it .
Create_Q gets the identifier of the messege queue.
/*********************CODE******************/
fd_set readfds;
struct msgbuf msg;
int msgPipe;
msgPipe=Create_Q("/tmp/Key",'a');
printf("Message queue id: %d \n",msgPipe);
FD_ZERO(&readfds);
FD_SET(msgPipe,&readfds);
FD_SET(hServerSocket,&readfds);
select(msgPipe+1, &readfds, NULL, NULL,NULL);
if (FD_ISSET(hServerSocket, &readfds))
printf("Data on socket\n");
else
printf("Data on Queue\n");