diff options
author | nobody <nobody@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1997-01-01 08:00:34 +0000 |
---|---|---|
committer | nobody <nobody@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1997-01-01 08:00:34 +0000 |
commit | 437eea6fa08e931864f89be91d14a816f69075c7 (patch) | |
tree | b8c1fd723fdcd61c3855d3a3a21a9cd45a268219 /examples/IPC_SAP/TLI_SAP/ftp-client.cpp | |
parent | ea0d28240863caf437a18071bfd03e7b146c5ade (diff) | |
download | ATCD-unlabeled-4.2.2.tar.gz |
This commit was manufactured by cvs2svn to create branchunlabeled-4.2.2
'unlabeled-4.2.2'.
Diffstat (limited to 'examples/IPC_SAP/TLI_SAP/ftp-client.cpp')
-rw-r--r-- | examples/IPC_SAP/TLI_SAP/ftp-client.cpp | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/examples/IPC_SAP/TLI_SAP/ftp-client.cpp b/examples/IPC_SAP/TLI_SAP/ftp-client.cpp deleted file mode 100644 index ae5bdece3f5..00000000000 --- a/examples/IPC_SAP/TLI_SAP/ftp-client.cpp +++ /dev/null @@ -1,45 +0,0 @@ - -// $Id$ - -#include "ace/TLI_Connector.h" - -#if defined (ACE_HAS_TLI) - -const int MAXLINE = 255; - -int -main (int argc, char *argv[]) -{ - if (argc < 2) - ACE_OS::fprintf (stderr, "Usage: %s filename [server-host port-number]\n", argv[0]), ACE_OS::exit (1); - - const char *filename = argv[1]; - const char *host_name = argc < 3 ? ACE_DEFAULT_SERVER_HOST : argv[2]; - unsigned short port = argc < 4 ? ACE_DEFAULT_SERVER_PORT : ACE_OS::atoi (argv[3]); - - ACE_TLI_Stream client; - ACE_TLI_Connector con; - int fd; - char buf[BUFSIZ]; - - if (con.connect (client, ACE_INET_Addr (port, host_name)) == -1) - ACE_OS::t_error ((char *) host_name), ACE_OS::exit (1); - - if ((fd = ACE_OS::open (filename, O_RDONLY)) == -1) - ACE_OS::perror (filename), ACE_OS::exit (1); - - for (int n; (n = ACE_OS::read (fd, buf, sizeof buf)) > 0; ) - if (client.send_n (buf, n) != n) - ACE_OS::t_error ("client.send error"); - - if (client.close () == -1) - ACE_OS::t_error ("cli_close"), ACE_OS::exit (1); - - return 0; -} -#else -int main (void) -{ - ACE_ERROR_RETURN ((LM_ERROR, "your platform does not support ACE_TLI\n"), 1); -} -#endif /* ACE_HAS_TLI */ |