From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,4ffb96a67e9483ce X-Google-Attributes: gidfee84,public From: martin@mjedev.demon.co.uk (Martin J. Evans) Subject: Re: Can "select" multiplex IPC message queues on DEC UNIX? Date: 1996/09/05 Message-ID: <322f5ea3.5673438@news.demon.co.uk>#1/1 X-Deja-AN: 178762276 x-nntp-posting-host: mjedev.demon.co.uk references: reply-to: martin@mjedev.demon.co.uk newsgroups: comp.unix.osf.osf1 Ken Reed wrote: > >I want to receive messages on sockets (from a remote system) and from >local processes over IPC queues. It's not clear to me from the manual >pages if the message queue ID used by the IPC routines (msgrcv, >msgget, etc) are file descriptors that will work with select. > >Anyone know the answer? > >Ken > I've not got a Digital UNIX machine in front of me now so it's difficult for me to check but from what I remember from other Unixes (HP-UX, Solaris, AIX etc) you get an identifier back from the routine that creates (or obtains) a message queue and not a file descriptor. A such, you cannot use select() as it only works with file descriptors. However, there are if my memory serves me well, functions for returning the number of messages on an IPC message queue and so you could possibly write your own select() which combines socket file descriptors and message queue identifiers so long as you did not want to implement the timout facility that select() normally provides. This solution would most probably result in some sort of wasteful cpu intensive loop but that might not matter to you. The company I work for has some code that processes messages arriving on sockets and messages arriving on IPC message queues but the frequncy of the IPC messages is far less than that on the sockets. The code occasionally looks at the message queues which receive client requests but mainly gives priority to data arriving on the socket. Martin -- Martin J. Evans (martin@mjedev.demon.co.uk) Leeds, UK