1 #include "ace/OS_main.h"
2 #include "ace/OS_Memory.h"
3 #include "ace/SPIPE_Addr.h"
4 #include "ace/SPIPE_Connector.h"
5 #include "ace/Log_Msg.h"
6 #include "ace/OS_NS_stdio.h"
7 #include "ace/OS_NS_stdlib.h"
8 #include "ace/OS_NS_unistd.h"
9 #include "ace/Time_Value.h"
12 #if defined (ACE_HAS_STREAM_PIPES)
16 const int DEFAULT_SIZE
= 4 * 1024;
17 const int DEFAULT_COUNT
= 100;
20 ACE_TMAIN (int argc
, ACE_TCHAR
*argv
[])
22 int size
= argc
> 1 ? ACE_OS::atoi (argv
[1]) : DEFAULT_SIZE
;
23 int iterations
= argc
> 2 ? ACE_OS::atoi (argv
[2]) : DEFAULT_COUNT
;
26 ACE_NEW_RETURN (buf
, char[size
], -1);
31 ACE_SPIPE_Stream cli_stream
;
32 ACE_SPIPE_Connector con
;
35 if (con
.connect (cli_stream
, ACE_SPIPE_Addr (rendezvous
)) == -1)
36 ACE_ERROR_RETURN ((LM_ERROR
, "%p\n", rendezvous
), 1);
38 for (i
= 0; i
< size
; i
++)
41 ACE_Str_Buf
buffer (buf
, size
);
43 for (i
= 0; i
< iterations
; i
++)
44 if (cli_stream
.send ((ACE_Str_Buf
*) 0,
48 ACE_ERROR_RETURN ((LM_ERROR
, "%p\n", "send"), 1);
50 if (cli_stream
.close () == -1)
51 ACE_ERROR_RETURN ((LM_ERROR
, "%p\n", "close"), 1);
58 int ACE_TMAIN (int, ACE_TCHAR
*[])
60 ACE_OS::fprintf (stderr
, "This feature is not supported\n");
63 #endif /* ACE_HAS_STREAM_PIPES */