diff options
author | nobody <nobody@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1996-12-30 06:50:29 +0000 |
---|---|---|
committer | nobody <nobody@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1996-12-30 06:50:29 +0000 |
commit | a4a7690c336d4c8a16b3041c86d501ba38226e96 (patch) | |
tree | 9e9f93a98edd2591453f092d178ad29a1c5fb519 /examples/System_V_IPC/SV_Message_Queues/TMQ_Server.cpp | |
parent | a5c4d8047ab58df5c45092e18ae503ad40518f0e (diff) | |
download | ATCD-unlabeled-4.1.2.tar.gz |
This commit was manufactured by cvs2svn to create branchunlabeled-4.1.2
'unlabeled-4.1.2'.
Diffstat (limited to 'examples/System_V_IPC/SV_Message_Queues/TMQ_Server.cpp')
-rw-r--r-- | examples/System_V_IPC/SV_Message_Queues/TMQ_Server.cpp | 60 |
1 files changed, 0 insertions, 60 deletions
diff --git a/examples/System_V_IPC/SV_Message_Queues/TMQ_Server.cpp b/examples/System_V_IPC/SV_Message_Queues/TMQ_Server.cpp deleted file mode 100644 index f5c5dd571b0..00000000000 --- a/examples/System_V_IPC/SV_Message_Queues/TMQ_Server.cpp +++ /dev/null @@ -1,60 +0,0 @@ -// $Id$ - -#include "ace/Signal.h" -#include "ace/Typed_SV_Message_Queue.h" - -#include "test.h" - -// Must be global for signal Message... -static ACE_Typed_SV_Message_Queue<Message_Data> msgque - (SRV_KEY, ACE_Typed_SV_Message_Queue<Message_Data>::ACE_CREATE); - -extern "C" void -handler (int) -{ - if (msgque.remove () < 0) - ACE_ERROR ((LM_ERROR, "%p\n%a", "msgque.recv", 1)); - ACE_OS::exit (0); -} - -int -main (void) -{ - char *username = ACE_OS::cuserid (0); - Message_Data msg_data ((int) ACE_OS::getpid (), username, "I received your message."); - ACE_Typed_SV_Message<Message_Data> send_msg (msg_data, 0, msg_data.length ()); - ACE_Typed_SV_Message<Message_Data> recv_msg (SRV_ID); - - // Register a signal handler. - ACE_Sig_Action sa ((ACE_SignalHandler) handler, SIGINT); - - for (;;) - { - if (msgque.recv (recv_msg) == -1) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "msgque.recv"), 1); - - Message_Data &recv_msg_data = recv_msg.data (); - - cout << "a msg of length " - << recv_msg_data.length () - << " sent from client " - << recv_msg_data.pid () - << " (user " - << recv_msg_data.user () << "): " - << recv_msg_data.text () << "\n"; - cout.flush (); - - send_msg.type (recv_msg_data.pid ()); - - if (msgque.send (send_msg) < 0) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "msgque.send"), 1); - } - - /* NOTREACHED */ - return 0; -} - -#if defined (ACE_TEMPLATES_REQUIRE_SPECIALIZATION) -template class ACE_Typed_SV_Message_Queue<Message_Data>; -template class ACE_Typed_SV_Message<Message_Data>; -#endif /* ACE_TEMPLATES_REQUIRE_SPECIALIZATION */ |