Use =default for skeleton copy constructor
[ACE_TAO.git] / ACE / examples / IPC_SAP / SPIPE_SAP / client.cpp
blob37ea3bdc535298191c94cd0c44b45005491d583f
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_stdio.h"
6 #include "ace/OS_NS_string.h"
9 #if defined (ACE_HAS_STREAM_PIPES)
11 #include "shared.h"
13 int
14 ACE_TMAIN (int argc, ACE_TCHAR *argv[])
16 if (argc < 2)
17 ACE_ERROR_RETURN ((LM_ERROR, "usage: %s string [rendezvous]\n", argv[0]), 1);
19 if (argc > 2)
20 rendezvous = argv[2];
22 ACE_SPIPE_Stream cli_stream;
23 ACE_SPIPE_Connector con;
25 if (con.connect (cli_stream, ACE_SPIPE_Addr (rendezvous)) == -1)
26 ACE_ERROR_RETURN ((LM_ERROR, "%p\n", rendezvous), 1);
28 ssize_t len = ACE_OS::strlen (argv[1]) + 1;
30 if (cli_stream.send (argv[1], len) != len)
31 ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "send"), 1);
33 if (cli_stream.close () == -1)
34 ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "close"), 1);
36 return 0;
38 #else
39 #include <stdio.h>
40 int ACE_TMAIN (int, ACE_TCHAR *[])
42 ACE_OS::fprintf (stderr, "This feature is not supported\n");
43 return 0;
45 #endif /* ACE_HAS_STREAM_PIPES */