1 // This tests the features of the <ACE_MEM_Connector> and
2 // <ACE_MEM_Stream> classes. In addition, it can be used to test the
3 // oneway and twoway latency and throughput at the socket-level. This
4 // is useful as a baseline to compare against ORB-level performance
5 // for the same types of data.
7 #include "ace/OS_NS_string.h"
8 #include "ace/MEM_Connector.h"
9 #include "ace/INET_Addr.h"
10 #include "ace/Thread_Manager.h"
11 #include "ace/Singleton.h"
12 #include "ace/Get_Opt.h"
13 #include "ace/High_Res_Timer.h"
18 ACE_MEM_Connector connector
;
19 ACE_MEM_Stream stream
;
20 ACE_MEM_Addr
server_addr (ACE_DEFAULT_SERVER_PORT
);
22 if (connector
.connect (stream
, server_addr
.get_remote_addr ()) == -1)
23 ACE_ERROR_RETURN ((LM_ERROR
, ACE_TEXT ("%p\n"),
24 ACE_TEXT ("connect")), -1);
26 char buf
[MAXPATHLEN
];
27 while (ACE_OS::fgets (buf
, MAXPATHLEN
, stdin
) != 0)
29 stream
.send (buf
, ACE_OS::strlen (buf
)+1);
30 stream
.recv (buf
, MAXPATHLEN
);
31 ACE_DEBUG ((LM_DEBUG
, ACE_TEXT ("Echo: %C\n"), buf
));
37 int ACE_TMAIN (int, ACE_TCHAR
*argv
[])
39 // Initialize the logger.
40 ACE_LOG_MSG
->open (argv
[0]);