1 #include "ace/Typed_SV_Message_Queue.h"
3 // FUZZ: disable check_for_streams_include
4 #include "ace/streams.h"
6 #include "ace/Log_Msg.h"
8 #include "ace/OS_NS_stdio.h"
9 #include "ace/OS_NS_unistd.h"
13 ACE_TMAIN (int, ACE_TCHAR
*[])
15 long pid
= long (ACE_OS::getpid ());
17 ACE_Typed_SV_Message_Queue
<Message_Data
> msgque (key_t (SRV_KEY
));
19 #if !defined(ACE_LACKS_CUSERID)
20 Message_Data
msg_data (pid
,
21 ACE_OS::cuserid (static_cast<char *> (0)),
24 Message_Data
msg_data (pid
,
29 ACE_Typed_SV_Message
<Message_Data
> send_msg (msg_data
,
34 if (msgque
.send (send_msg
) < 0)
35 ACE_ERROR_RETURN ((LM_ERROR
, ACE_TEXT ("%p\n"),
36 ACE_TEXT ("msgque.send")), 1);
38 if (msgque
.recv (recv_msg
) < 0)
39 ACE_ERROR_RETURN ((LM_ERROR
, ACE_TEXT ("%p\n"),
40 ACE_TEXT ("msgque.recv")), 1);
42 Message_Data
&recv_msg_data
= recv_msg
.data ();
45 ACE_TEXT ("a message of length %d")
46 ACE_TEXT (" received from server %d")
47 ACE_TEXT (" (user %C): %C\n"),
48 recv_msg_data
.length (),
50 recv_msg_data
.user (),
51 recv_msg_data
.text ()));