title: Which is better for local IPC, POSIX message queues (mqueues) or Unix domain (local) sockets?
body: <p>Is it better to use POSIX message queues or Unix domain sockets for local IPC communication?</p>
  
  <p>I have worked with Unix sockets between machines (not domain) and I remember that making and breaking the connection would cause sockets to linger awhile before they finally went away. Moreover, if you wanted a "reliable" exchange you either had to use TCP or design the application to return an ACK. I'm not certain if this also applies to Unix domain sockets though.</p>
  
  <p>In my current project we need local IPC. My first reaction was to use POSIX MQueues, since I've used them before for local messaging. However, a co-worker is suggesting Unix domain sockets instead.</p>
  
  <p>Is one better than the other, or is it a matter of programming familiarity? Or perhaps its depends upon the application being created?</p>
  
  <p>At a big picture the application we are working on follows a client/server model. The clients send messages to the server to "do something". However, the client doesn't wait for an "its done" response -- although they do want to know if their request has been received or not.</p>
  
  <p>The basic logic for the send side is:</p>
  
  <pre><code>connect to server
  send request
  note if the send worked or not
  disconnect from server
  </code></pre>
  
  <p>There can be hundreds of clients to the one server.</p>
  
  <p>We're are executing on an SMP system (4-8 cores) running the Linux OS.</p>
  
  <p>Thanks in advance.</p>