1 #include "ace/INET_Addr.h"
2 #include "ace/SOCK_Stream.h"
3 #include "ace/SOCK_Connector.h"
4 #include "ace/Log_Msg.h"
5 #include "ace/OS_NS_unistd.h"
7 int ACE_TMAIN (int, ACE_TCHAR
*[])
10 ACE_INET_Addr
srvr (50000, ACE_LOCALHOST
);
13 // Listing 2 code/ch06
14 ACE_SOCK_Connector connector
;
17 if (-1 == connector
.connect (peer
, srvr
))
18 ACE_ERROR_RETURN ((LM_ERROR
,
20 ACE_TEXT ("connect")), 1);
26 // Listing 3 code/ch06
27 peer
.send_n ("uptime\n", 7);
28 bc
= peer
.recv (buf
, sizeof(buf
));
29 ACE_OS::write (ACE_STDOUT
, buf
, bc
);