1 #include "ace/OS_main.h"
2 #include "ace/SPIPE_Addr.h"
3 #include "ace/SPIPE_Connector.h"
4 #include "ace/Log_Msg.h"
5 #include "ace/OS_NS_stdlib.h"
9 #if defined (ACE_HAS_STREAM_PIPES)
13 const int DEFAULT_SIZE
= 8 * 1024;
14 const int DEFAULT_COUNT
= 100;
17 ACE_TMAIN (int argc
, ACE_TCHAR
*argv
[])
19 int size
= argc
> 1 ? ACE_OS::atoi (argv
[1]) : DEFAULT_SIZE
;
20 int iterations
= argc
> 2 ? ACE_OS::atoi (argv
[2]) : DEFAULT_COUNT
;
21 char *buf
= new char[size
];
26 ACE_SPIPE_Stream cli_stream
;
27 ACE_SPIPE_Connector con
;
30 if (con
.connect (cli_stream
, ACE_SPIPE_Addr (rendezvous
)) == -1)
31 ACE_ERROR_RETURN ((LM_ERROR
, "%p\n", rendezvous
), -1);
33 for (i
= 0; i
< size
; i
++)
36 for (i
= 0; i
< iterations
; i
++)
37 if (cli_stream
.send (buf
, size
) != size
)
38 ACE_ERROR_RETURN ((LM_ERROR
, "%p\n", "putmsg"), -1);
40 if (cli_stream
.close () == -1)
41 ACE_ERROR_RETURN ((LM_ERROR
, "%p\n", "close"), -1);
47 int ACE_TMAIN (int, ACE_TCHAR
*[])
49 ACE_ERROR_RETURN ((LM_ERROR
, "this feature is not supported"), -1);
51 #endif /* ACE_HAS_STREAM_PIPES */