Merge pull request #2216 from jwillemsen/jwi-cxxversionchecks
[ACE_TAO.git] / ACE / examples / IPC_SAP / FIFO_SAP / FIFO-client.cpp
blob9f27ef580b9a781faca95fe65fe6d6a8defdbddf
1 #include "ace/FIFO_Send.h"
2 #include "ace/Log_Msg.h"
3 #include "ace/Truncate.h"
4 #include "ace/OS_NS_string.h"
5 #include "ace/OS_NS_stdio.h"
6 #include "ace/OS_main.h"
9 int
10 ACE_TMAIN (int, ACE_TCHAR *[])
12 ACE_FIFO_Send client (ACE_DEFAULT_RENDEZVOUS);
13 ACE_TCHAR buf[BUFSIZ];
15 while (ACE_OS::fgets (buf, sizeof buf, stdin) != 0)
17 ssize_t n = ACE_Utils::truncate_cast<ssize_t> (ACE_OS::strlen (buf));
19 if (client.send (buf, n) != n)
20 ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "send"), 1);
23 if (client.close () == -1)
24 ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "close"), 1);
26 return 0;