Merge pull request #2216 from jwillemsen/jwi-cxxversionchecks
[ACE_TAO.git] / ACE / examples / IPC_SAP / FIFO_SAP / FIFO-server.cpp
blob918f533b8c878e55fe3e2633dc2d37a7f92177bd
1 #include "ace/FIFO_Recv.h"
2 #include "ace/Log_Msg.h"
3 #include "ace/OS_NS_stdio.h"
4 #include "ace/OS_NS_unistd.h"
5 #include "ace/OS_main.h"
8 int
9 ACE_TMAIN (int, ACE_TCHAR *[])
11 ACE_OS::unlink (ACE_DEFAULT_RENDEZVOUS);
12 ACE_FIFO_Recv server (ACE_DEFAULT_RENDEZVOUS);
13 char buf[BUFSIZ];
14 int n;
16 while ((n = server.recv (buf, sizeof buf)) > 0)
18 ACE_OS::printf ("%4d: ", n);
19 ACE_OS::fflush (stdout);
20 ACE_OS::write (ACE_STDOUT, buf, n);
23 if (n == -1)
24 ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "recv"), 1);
26 return 0;