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 | |
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')
51 files changed, 0 insertions, 3864 deletions
diff --git a/examples/IPC_SAP/DEV_SAP/Makefile b/examples/IPC_SAP/DEV_SAP/Makefile deleted file mode 100644 index d596bd3d53c..00000000000 --- a/examples/IPC_SAP/DEV_SAP/Makefile +++ /dev/null @@ -1,22 +0,0 @@ -#---------------------------------------------------------------------------- -# @(#)Makefile 1.1 10/18/96 -# -# Makefile for the DEV_SAP test directory -#---------------------------------------------------------------------------- - -#---------------------------------------------------------------------------- -# Local macros -#---------------------------------------------------------------------------- - -DIRS = reader \ - writer - -#---------------------------------------------------------------------------- -# macros and targets -#---------------------------------------------------------------------------- - -include $(WRAPPER_ROOT)/include/makeinclude/wrapper_macros.GNU -include $(WRAPPER_ROOT)/include/makeinclude/macros.GNU -include $(WRAPPER_ROOT)/include/makeinclude/rules.common.GNU -include $(WRAPPER_ROOT)/include/makeinclude/rules.nested.GNU -include $(WRAPPER_ROOT)/include/makeinclude/rules.nolocal.GNU diff --git a/examples/IPC_SAP/DEV_SAP/README b/examples/IPC_SAP/DEV_SAP/README deleted file mode 100644 index 8e47d8c5cec..00000000000 --- a/examples/IPC_SAP/DEV_SAP/README +++ /dev/null @@ -1,23 +0,0 @@ -This directory contains a test example for the DEV_SAP -class category. It implements a class TTY_IO that is -derived from ACE_DEV_IO and adds a control method -with specific features for a serial line connection -(e.g. /dev/ttya and /dev/ttyb on UNIX systems). - -The reader/reader executable initializes its -device-special file (given as command-line parameter), -reads characters from it (until it recognizes character 'q') -ands sends the characters read to stdout. - -The writer/writer executable also initializes its -device-special file (given as command-line parameter), -reads characters from stdin (until'q') and sends them -to the device. - -To run the tests I connect /dev/ttya and /dev/ttyb (with a -zero modem cable) and start the reader with "reader /dev/ttya" -and the writer (in a different window) with "writer /dev/ttyb". - -Characters typed in the writer window should now appear as output -in the reader window. Note that characters are buffered till EOL. - diff --git a/examples/IPC_SAP/DEV_SAP/reader/Makefile b/examples/IPC_SAP/DEV_SAP/reader/Makefile deleted file mode 100644 index fb56477c9b1..00000000000 --- a/examples/IPC_SAP/DEV_SAP/reader/Makefile +++ /dev/null @@ -1,72 +0,0 @@ -#---------------------------------------------------------------------------- -# @(#)Makefile 1.1 10/18/96 -# -# Makefile for the simple DEV reader test file -# for serial devices -#---------------------------------------------------------------------------- - -#---------------------------------------------------------------------------- -# Local macros -#---------------------------------------------------------------------------- - -BIN = reader - -SRC = $(addsuffix .cpp,$(BIN)) -OBJ = $(SRC:%.cpp=$(VDIR)%.o) - -LSRC = $(addsuffix .cpp,$(FILES)) -LOBJ = $(addsuffix .o,$(FILES)) -SHOBJ = $(addsuffix .so,$(FILES)) - -LIBS = -lACE - -VLDLIBS = $(LDLIBS:%=%$(VAR)) - -BUILD = $(VBIN) - -#---------------------------------------------------------------------------- -# Include macros and targets -#---------------------------------------------------------------------------- - -include $(WRAPPER_ROOT)/include/makeinclude/wrapper_macros.GNU -include $(WRAPPER_ROOT)/include/makeinclude/macros.GNU -include $(WRAPPER_ROOT)/include/makeinclude/rules.common.GNU -include $(WRAPPER_ROOT)/include/makeinclude/rules.nonested.GNU -include $(WRAPPER_ROOT)/include/makeinclude/rules.bin.GNU -include $(WRAPPER_ROOT)/include/makeinclude/rules.local.GNU - -#---------------------------------------------------------------------------- -# Local targets -#---------------------------------------------------------------------------- - -#---------------------------------------------------------------------------- -# Dependencies -#---------------------------------------------------------------------------- -# DO NOT DELETE THIS LINE -- g++dep uses it. -# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. - -.obj/reader.o .shobj/reader.so: reader.cpp \ - $(WRAPPER_ROOT)/ace/OS.h \ - $(WRAPPER_ROOT)/ace/Time_Value.h \ - $(WRAPPER_ROOT)/ace/config.h \ - $(WRAPPER_ROOT)/ace/stdcpp.h \ - $(WRAPPER_ROOT)/ace/Trace.h \ - $(WRAPPER_ROOT)/ace/Log_Msg.h \ - $(WRAPPER_ROOT)/ace/Log_Record.h \ - $(WRAPPER_ROOT)/ace/Log_Priority.h \ - $(WRAPPER_ROOT)/ace/ACE.h \ - $(WRAPPER_ROOT)/ace/ACE.i \ - $(WRAPPER_ROOT)/ace/Log_Record.i \ - $(WRAPPER_ROOT)/ace/DEV_Addr.h \ - $(WRAPPER_ROOT)/ace/Addr.h \ - $(WRAPPER_ROOT)/ace/DEV_Connector.h \ - $(WRAPPER_ROOT)/ace/DEV_IO.h \ - $(WRAPPER_ROOT)/ace/DEV.h \ - $(WRAPPER_ROOT)/ace/IO_SAP.h \ - $(WRAPPER_ROOT)/ace/IO_SAP.i \ - $(WRAPPER_ROOT)/ace/DEV.i \ - $(WRAPPER_ROOT)/ace/DEV_IO.i \ - $(WRAPPER_ROOT)/ace/DEV_Connector.i \ - $(WRAPPER_ROOT)/ace/TTY_IO.h - -# IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/examples/IPC_SAP/DEV_SAP/reader/reader.cpp b/examples/IPC_SAP/DEV_SAP/reader/reader.cpp deleted file mode 100644 index 1741c209c13..00000000000 --- a/examples/IPC_SAP/DEV_SAP/reader/reader.cpp +++ /dev/null @@ -1,49 +0,0 @@ - -// $Id$ - -#include "ace/OS.h" -#include "ace/DEV_Addr.h" -#include "ace/DEV_Connector.h" -#include "ace/DEV_IO.h" -#include "ace/TTY_IO.h" - -int -main (int argc, char *argv[]) -{ - if (argc < 2) - ACE_ERROR_RETURN ((LM_ERROR, "usage: %s device-filename\n", argv[0]), 1); - - ACE_TTY_IO read_dev; - ACE_DEV_Connector con; - - if (con.connect (read_dev, ACE_DEV_Addr (argv[1])) == -1) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", argv[1]), 1); - - ACE_TTY_IO::Serial_Params myparams; - myparams.baudrate = 9600; - myparams.parityenb = 1; - myparams.paritymode = "EVEN"; - myparams.databits = 8; - myparams.stopbits = 1; - myparams.readtimeoutmsec = 10000; - myparams.ctsenb = 0; - myparams.rcvenb = 1; - - int ret = read_dev.control (ACE_TTY_IO::SETPARAMS, &myparams); - - if (ret == -1) - ACE_ERROR_RETURN ((LM_ERROR, "%p control\n", argv[1]), 1); - - // Read till character 'q'. - for (char readback = 'x'; readback != 'q'; ) - { - ssize_t bytes_read = read_dev.recv_n ((void *) &readback, 1); - - if (bytes_read == 1) - ACE_DEBUG ((LM_DEBUG, "read: %c\n", readback)); - else if (bytes_read == -1) - ACE_ERROR_RETURN ((LM_ERROR, "%p recv\n", argv[1]), 1); - } - - return 0; -} diff --git a/examples/IPC_SAP/DEV_SAP/writer/Makefile b/examples/IPC_SAP/DEV_SAP/writer/Makefile deleted file mode 100644 index 891a7dd49a0..00000000000 --- a/examples/IPC_SAP/DEV_SAP/writer/Makefile +++ /dev/null @@ -1,72 +0,0 @@ -#---------------------------------------------------------------------------- -# @(#)Makefile 1.1 10/18/96 -# -# Makefile for the simple DEV writer test file -# for serial devices -#---------------------------------------------------------------------------- - -#---------------------------------------------------------------------------- -# Local macros -#---------------------------------------------------------------------------- - -BIN = writer - -SRC = $(addsuffix .cpp,$(BIN)) -OBJ = $(SRC:%.cpp=$(VDIR)%.o) - -LSRC = $(addsuffix .cpp,$(FILES)) -LOBJ = $(addsuffix .o,$(FILES)) -SHOBJ = $(addsuffix .so,$(FILES)) - -LIBS = -lACE - -VLDLIBS = $(LDLIBS:%=%$(VAR)) - -BUILD = $(VBIN) - -#---------------------------------------------------------------------------- -# Include macros and targets -#---------------------------------------------------------------------------- - -include $(WRAPPER_ROOT)/include/makeinclude/wrapper_macros.GNU -include $(WRAPPER_ROOT)/include/makeinclude/macros.GNU -include $(WRAPPER_ROOT)/include/makeinclude/rules.common.GNU -include $(WRAPPER_ROOT)/include/makeinclude/rules.nonested.GNU -include $(WRAPPER_ROOT)/include/makeinclude/rules.bin.GNU -include $(WRAPPER_ROOT)/include/makeinclude/rules.local.GNU - -#---------------------------------------------------------------------------- -# Local targets -#---------------------------------------------------------------------------- - -#---------------------------------------------------------------------------- -# Dependencies -#---------------------------------------------------------------------------- -# DO NOT DELETE THIS LINE -- g++dep uses it. -# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. - -.obj/writer.o .shobj/writer.so: writer.cpp \ - $(WRAPPER_ROOT)/ace/DEV_Connector.h \ - $(WRAPPER_ROOT)/ace/DEV_IO.h \ - $(WRAPPER_ROOT)/ace/DEV.h \ - $(WRAPPER_ROOT)/ace/IO_SAP.h \ - $(WRAPPER_ROOT)/ace/ACE.h \ - $(WRAPPER_ROOT)/ace/OS.h \ - $(WRAPPER_ROOT)/ace/Time_Value.h \ - $(WRAPPER_ROOT)/ace/config.h \ - $(WRAPPER_ROOT)/ace/stdcpp.h \ - $(WRAPPER_ROOT)/ace/Trace.h \ - $(WRAPPER_ROOT)/ace/Log_Msg.h \ - $(WRAPPER_ROOT)/ace/Log_Record.h \ - $(WRAPPER_ROOT)/ace/Log_Priority.h \ - $(WRAPPER_ROOT)/ace/Log_Record.i \ - $(WRAPPER_ROOT)/ace/ACE.i \ - $(WRAPPER_ROOT)/ace/IO_SAP.i \ - $(WRAPPER_ROOT)/ace/DEV_Addr.h \ - $(WRAPPER_ROOT)/ace/Addr.h \ - $(WRAPPER_ROOT)/ace/DEV.i \ - $(WRAPPER_ROOT)/ace/DEV_IO.i \ - $(WRAPPER_ROOT)/ace/DEV_Connector.i \ - $(WRAPPER_ROOT)/ace/TTY_IO.h - -# IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/examples/IPC_SAP/DEV_SAP/writer/writer.cpp b/examples/IPC_SAP/DEV_SAP/writer/writer.cpp deleted file mode 100644 index 2f0216c2c25..00000000000 --- a/examples/IPC_SAP/DEV_SAP/writer/writer.cpp +++ /dev/null @@ -1,54 +0,0 @@ - -// $Id$ - -#include "ace/DEV_Connector.h" -#include "ace/TTY_IO.h" - -int -main (int argc, char *argv[]) -{ - if (argc < 2) - ACE_ERROR_RETURN ((LM_ERROR, "usage: %s device-filename\n", argv[0]), 1); - - ACE_TTY_IO write_dev; - - ACE_DEV_Connector con; - - if (con.connect (write_dev, ACE_DEV_Addr (argv[1])) == -1) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", argv[1]), 1); - - ACE_TTY_IO::Serial_Params myparams; - myparams.baudrate = 9600; - myparams.parityenb = 1; - myparams.paritymode = "EVEN"; - myparams.databits = 8; - myparams.stopbits = 1; - myparams.readtimeoutmsec = 200; - myparams.ctsenb = 0; - myparams.rcvenb = 1; - - int ret = write_dev.control (ACE_TTY_IO::SETPARAMS, &myparams); - - if (ret == -1) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "control"), 1); - - ACE_DEBUG ((LM_DEBUG, "enter character to send, q terminates :\n")); - - for (char writeto = 'x'; - ACE_OS::read (ACE_STDIN, &writeto, 1) != -1; - ) - { - ssize_t bytes_written = write_dev.send_n ((void *)&writeto, 1); - - if (bytes_written != 1) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "send"), 1); - - if (writeto == 'q') - break; - } - - if (write_dev.close () == -1) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "close"), 1); - - return 0; -} diff --git a/examples/IPC_SAP/FIFO_SAP/FIFO-Msg-client.cpp b/examples/IPC_SAP/FIFO_SAP/FIFO-Msg-client.cpp deleted file mode 100644 index 09891379c86..00000000000 --- a/examples/IPC_SAP/FIFO_SAP/FIFO-Msg-client.cpp +++ /dev/null @@ -1,36 +0,0 @@ -#include "ace/FIFO_Send_Msg.h" -// $Id$ - - -#if defined (ACE_HAS_STREAM_PIPES) - -int -main (int, char *[]) -{ - ACE_FIFO_Send_Msg client (ACE_DEFAULT_RENDEZVOUS); - - char buf[BUFSIZ]; - ACE_Str_Buf msg (buf); - - ACE_OS::srand (unsigned (ACE_OS::time (0))); - - while (ACE_OS::fgets (buf, sizeof buf, stdin) != 0) - { - msg.len = strlen (buf) + 1; - if (client.send (ACE_OS::rand () % 11, &msg) == -1) - ::perror ("send"); - } - - if (client.close () == -1) - ACE_OS::perror ("close"), ACE_OS::exit (1); - - return 0; -} -#else -#include <stdio.h> -int main (void) -{ - ACE_OS::fprintf (stderr, "This feature is not supported\n"); - return 0; -} -#endif /* ACE_HAS_STREAM_PIPES */ diff --git a/examples/IPC_SAP/FIFO_SAP/FIFO-Msg-server.cpp b/examples/IPC_SAP/FIFO_SAP/FIFO-Msg-server.cpp deleted file mode 100644 index 6ad9575cdee..00000000000 --- a/examples/IPC_SAP/FIFO_SAP/FIFO-Msg-server.cpp +++ /dev/null @@ -1,41 +0,0 @@ -#include "ace/FIFO_Recv_Msg.h" -// $Id$ - - -#if defined (ACE_HAS_STREAM_PIPES) - -int -main (int, char *[]) -{ - ACE_OS::unlink (ACE_DEFAULT_RENDEZVOUS); - ACE_FIFO_Recv_Msg server (ACE_DEFAULT_RENDEZVOUS); - char buf[BUFSIZ]; - ACE_Str_Buf msg (buf, 0, sizeof buf); - int flags = MSG_ANY; - int band = 0; - int n; - - while ((n = server.recv (&band, &msg, (ACE_Str_Buf *) 0, &flags)) >= 0) - { - if (msg.len == 0) - break; - else - ACE_DEBUG ((LM_DEBUG, "%4d (%4d): %*s", - msg.len, band, msg.len, msg.buf)); - flags = MSG_ANY; - band = 0; - } - - if (n == -1) - ACE_OS::perror ("recv"), ACE_OS::exit (1); - - return 0; -} -#else -#include <stdio.h> -int main (void) -{ - ACE_OS::fprintf (stderr, "This feature is not supported\n"); - return 0; -} -#endif /* ACE_HAS_STREAM_PIPES */ diff --git a/examples/IPC_SAP/FIFO_SAP/FIFO-client.cpp b/examples/IPC_SAP/FIFO_SAP/FIFO-client.cpp deleted file mode 100644 index be447a3c73d..00000000000 --- a/examples/IPC_SAP/FIFO_SAP/FIFO-client.cpp +++ /dev/null @@ -1,24 +0,0 @@ - -// $Id$ - -#include "ace/FIFO_Send.h" - -int -main (int, char *[]) -{ - ACE_FIFO_Send client (ACE_DEFAULT_RENDEZVOUS); - char buf[BUFSIZ]; - - while (ACE_OS::fgets (buf, sizeof buf, stdin) != 0) - { - size_t n = ACE_OS::strlen (buf); - - if (client.send (buf, n) != n) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "send"), 1); - } - - if (client.close () == -1) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "close"), 1); - - return 0; -} diff --git a/examples/IPC_SAP/FIFO_SAP/FIFO-server.cpp b/examples/IPC_SAP/FIFO_SAP/FIFO-server.cpp deleted file mode 100644 index 205ff83501d..00000000000 --- a/examples/IPC_SAP/FIFO_SAP/FIFO-server.cpp +++ /dev/null @@ -1,25 +0,0 @@ - -// $Id$ - -#include "ace/FIFO_Recv.h" - -int -main (int, char *[]) -{ - ACE_OS::unlink (ACE_DEFAULT_RENDEZVOUS); - ACE_FIFO_Recv server (ACE_DEFAULT_RENDEZVOUS); - char buf[BUFSIZ]; - int n; - - while ((n = server.recv (buf, sizeof buf)) > 0) - { - ACE_OS::printf ("%4d: ", n); - ACE_OS::fflush (stdout); - ACE_OS::write (ACE_STDOUT, buf, n); - } - - if (n == -1) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "recv"), 1); - - return 0; -} diff --git a/examples/IPC_SAP/FIFO_SAP/FIFO-test.cpp b/examples/IPC_SAP/FIFO_SAP/FIFO-test.cpp deleted file mode 100644 index 0e7004584ee..00000000000 --- a/examples/IPC_SAP/FIFO_SAP/FIFO-test.cpp +++ /dev/null @@ -1,95 +0,0 @@ -// $Id$ - -// Purpose: This program uses ACE_FIFO wrappers to perform -// interprocess communication between a parent process and a child -// process. The parents reads from an input file and writes it into -// the fifo. The child reads from the ACE_FIFO and executes the more -// command. - - -#include "ace/FIFO_Recv.h" -#include "ace/FIFO_Send.h" - -#define PERMS 0666 -#define EXEC_NAME "more" -#define EXEC_COMMAND_ARG "more" - -const char *FIFO_NAME = "/tmp/fifo"; - -int -do_child (ACE_FIFO_Recv &fifo_reader) -{ - // Set child's stdin to read from the fifo. - if (ACE_OS::close (0) == -1 || ACE_OS::dup (fifo_reader.get_handle ()) == -1) - return -1; - - char *argv[2]; - argv[0] = EXEC_COMMAND_ARG; - argv[1] = 0; - - if (ACE_OS::execvp (EXEC_NAME, argv) == -1) - return -1; - return 0; -} - -int -do_parent (const char fifo_name[], char input_filename[]) -{ - int inputfd; - ACE_FIFO_Send fifo_sender (fifo_name, O_WRONLY | O_CREAT); - int len; - char buf[BUFSIZ]; - - if (fifo_sender.get_handle () == ACE_INVALID_HANDLE) - return -1; - - if ((inputfd = ACE_OS::open (input_filename, O_RDONLY)) == -1) - return -1; - - // Read from input file and write into input end of the fifo. - - while ((len = ACE_OS::read (inputfd, buf, sizeof buf)) > 0) - if (fifo_sender.send (buf, len) != len) - return -1; - - if (len == -1) - return -1; - - if (fifo_sender.remove () == -1) - return -1; - return 0; -} - -int -main (int argc, char *argv[]) -{ - ACE_LOG_MSG->open (argv[0]); - - if (argc != 2) - ACE_ERROR ((LM_ERROR, "usage: %n input-file\n%a", 1)); - - ACE_FIFO_Recv fifo_reader (FIFO_NAME, O_RDONLY | O_CREAT, PERMS, 0); - - if (fifo_reader.get_handle () == ACE_INVALID_HANDLE) - return -1; - - pid_t child_pid; - - switch (child_pid = ACE_OS::fork ()) - { - case -1: - ACE_ERROR ((LM_ERROR, "%n: %p\n%a", "fork", 1)); - case 0: - if (do_child (fifo_reader) == -1) - ACE_ERROR ((LM_ERROR, "%n: %p\n%a", "do_child", 1)); - default: - if (do_parent (FIFO_NAME, argv[1]) == -1) - ACE_ERROR ((LM_ERROR, "%n: %p\n%a", "do_parent", 1)); - - // wait for child to ACE_OS::exit. - if (ACE_OS::waitpid (child_pid, (int *) 0, 0) == -1) - ACE_ERROR ((LM_ERROR, "%n: %p\n%a", "waitpid", 1)); - } - - return 0; -} diff --git a/examples/IPC_SAP/FIFO_SAP/Makefile b/examples/IPC_SAP/FIFO_SAP/Makefile deleted file mode 100644 index c88921eb4fc..00000000000 --- a/examples/IPC_SAP/FIFO_SAP/Makefile +++ /dev/null @@ -1,137 +0,0 @@ -#---------------------------------------------------------------------------- -# @(#)Makefile 1.1 10/18/96 -# -# Makefile for simple FIFO test -#---------------------------------------------------------------------------- - -#---------------------------------------------------------------------------- -# Local macros -#---------------------------------------------------------------------------- - -BIN = FIFO-Msg-client \ - FIFO-Msg-server \ - FIFO-client \ - FIFO-server \ - FIFO-test - -LSRC = $(addsuffix .cpp,$(BIN)) - -VLDLIBS = $(LDLIBS:%=%$(VAR)) - -BUILD = $(VBIN) - -#---------------------------------------------------------------------------- -# Include macros and targets -#---------------------------------------------------------------------------- - -include $(WRAPPER_ROOT)/include/makeinclude/wrapper_macros.GNU -include $(WRAPPER_ROOT)/include/makeinclude/macros.GNU -include $(WRAPPER_ROOT)/include/makeinclude/rules.common.GNU -include $(WRAPPER_ROOT)/include/makeinclude/rules.nonested.GNU -include $(WRAPPER_ROOT)/include/makeinclude/rules.bin.GNU -include $(WRAPPER_ROOT)/include/makeinclude/rules.local.GNU - -#---------------------------------------------------------------------------- -# Local targets -#---------------------------------------------------------------------------- - -#---------------------------------------------------------------------------- -# Dependencies -#---------------------------------------------------------------------------- - -# DO NOT DELETE THIS LINE -- g++dep uses it. -# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. - -.obj/FIFO-Msg-client.o .shobj/FIFO-Msg-client.so: FIFO-Msg-client.cpp \ - $(WRAPPER_ROOT)/ace/FIFO_Send_Msg.h \ - $(WRAPPER_ROOT)/ace/FIFO_Send.h \ - $(WRAPPER_ROOT)/ace/FIFO.h \ - $(WRAPPER_ROOT)/ace/IPC_SAP.h \ - $(WRAPPER_ROOT)/ace/ACE.h \ - $(WRAPPER_ROOT)/ace/OS.h \ - $(WRAPPER_ROOT)/ace/Time_Value.h \ - $(WRAPPER_ROOT)/ace/config.h \ - $(WRAPPER_ROOT)/ace/stdcpp.h \ - $(WRAPPER_ROOT)/ace/Trace.h \ - $(WRAPPER_ROOT)/ace/Log_Msg.h \ - $(WRAPPER_ROOT)/ace/Log_Record.h \ - $(WRAPPER_ROOT)/ace/Log_Priority.h \ - $(WRAPPER_ROOT)/ace/Log_Record.i \ - $(WRAPPER_ROOT)/ace/ACE.i \ - $(WRAPPER_ROOT)/ace/IPC_SAP.i \ - $(WRAPPER_ROOT)/ace/FIFO_Send.i \ - $(WRAPPER_ROOT)/ace/FIFO_Send_Msg.i -.obj/FIFO-Msg-server.o .shobj/FIFO-Msg-server.so: FIFO-Msg-server.cpp \ - $(WRAPPER_ROOT)/ace/FIFO_Recv_Msg.h \ - $(WRAPPER_ROOT)/ace/FIFO_Recv.h \ - $(WRAPPER_ROOT)/ace/FIFO.h \ - $(WRAPPER_ROOT)/ace/IPC_SAP.h \ - $(WRAPPER_ROOT)/ace/ACE.h \ - $(WRAPPER_ROOT)/ace/OS.h \ - $(WRAPPER_ROOT)/ace/Time_Value.h \ - $(WRAPPER_ROOT)/ace/config.h \ - $(WRAPPER_ROOT)/ace/stdcpp.h \ - $(WRAPPER_ROOT)/ace/Trace.h \ - $(WRAPPER_ROOT)/ace/Log_Msg.h \ - $(WRAPPER_ROOT)/ace/Log_Record.h \ - $(WRAPPER_ROOT)/ace/Log_Priority.h \ - $(WRAPPER_ROOT)/ace/Log_Record.i \ - $(WRAPPER_ROOT)/ace/ACE.i \ - $(WRAPPER_ROOT)/ace/IPC_SAP.i \ - $(WRAPPER_ROOT)/ace/FIFO_Recv.i \ - $(WRAPPER_ROOT)/ace/FIFO_Recv_Msg.i -.obj/FIFO-client.o .shobj/FIFO-client.so: FIFO-client.cpp \ - $(WRAPPER_ROOT)/ace/FIFO_Send.h \ - $(WRAPPER_ROOT)/ace/FIFO.h \ - $(WRAPPER_ROOT)/ace/IPC_SAP.h \ - $(WRAPPER_ROOT)/ace/ACE.h \ - $(WRAPPER_ROOT)/ace/OS.h \ - $(WRAPPER_ROOT)/ace/Time_Value.h \ - $(WRAPPER_ROOT)/ace/config.h \ - $(WRAPPER_ROOT)/ace/stdcpp.h \ - $(WRAPPER_ROOT)/ace/Trace.h \ - $(WRAPPER_ROOT)/ace/Log_Msg.h \ - $(WRAPPER_ROOT)/ace/Log_Record.h \ - $(WRAPPER_ROOT)/ace/Log_Priority.h \ - $(WRAPPER_ROOT)/ace/Log_Record.i \ - $(WRAPPER_ROOT)/ace/ACE.i \ - $(WRAPPER_ROOT)/ace/IPC_SAP.i \ - $(WRAPPER_ROOT)/ace/FIFO_Send.i -.obj/FIFO-server.o .shobj/FIFO-server.so: FIFO-server.cpp \ - $(WRAPPER_ROOT)/ace/FIFO_Recv.h \ - $(WRAPPER_ROOT)/ace/FIFO.h \ - $(WRAPPER_ROOT)/ace/IPC_SAP.h \ - $(WRAPPER_ROOT)/ace/ACE.h \ - $(WRAPPER_ROOT)/ace/OS.h \ - $(WRAPPER_ROOT)/ace/Time_Value.h \ - $(WRAPPER_ROOT)/ace/config.h \ - $(WRAPPER_ROOT)/ace/stdcpp.h \ - $(WRAPPER_ROOT)/ace/Trace.h \ - $(WRAPPER_ROOT)/ace/Log_Msg.h \ - $(WRAPPER_ROOT)/ace/Log_Record.h \ - $(WRAPPER_ROOT)/ace/Log_Priority.h \ - $(WRAPPER_ROOT)/ace/Log_Record.i \ - $(WRAPPER_ROOT)/ace/ACE.i \ - $(WRAPPER_ROOT)/ace/IPC_SAP.i \ - $(WRAPPER_ROOT)/ace/FIFO_Recv.i -.obj/FIFO-test.o .shobj/FIFO-test.so: FIFO-test.cpp \ - $(WRAPPER_ROOT)/ace/FIFO_Recv.h \ - $(WRAPPER_ROOT)/ace/FIFO.h \ - $(WRAPPER_ROOT)/ace/IPC_SAP.h \ - $(WRAPPER_ROOT)/ace/ACE.h \ - $(WRAPPER_ROOT)/ace/OS.h \ - $(WRAPPER_ROOT)/ace/Time_Value.h \ - $(WRAPPER_ROOT)/ace/config.h \ - $(WRAPPER_ROOT)/ace/stdcpp.h \ - $(WRAPPER_ROOT)/ace/Trace.h \ - $(WRAPPER_ROOT)/ace/Log_Msg.h \ - $(WRAPPER_ROOT)/ace/Log_Record.h \ - $(WRAPPER_ROOT)/ace/Log_Priority.h \ - $(WRAPPER_ROOT)/ace/Log_Record.i \ - $(WRAPPER_ROOT)/ace/ACE.i \ - $(WRAPPER_ROOT)/ace/IPC_SAP.i \ - $(WRAPPER_ROOT)/ace/FIFO_Recv.i \ - $(WRAPPER_ROOT)/ace/FIFO_Send.h \ - $(WRAPPER_ROOT)/ace/FIFO_Send.i - -# IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/examples/IPC_SAP/FILE_SAP/Makefile b/examples/IPC_SAP/FILE_SAP/Makefile deleted file mode 100644 index f24ef545e4a..00000000000 --- a/examples/IPC_SAP/FILE_SAP/Makefile +++ /dev/null @@ -1,63 +0,0 @@ -#---------------------------------------------------------------------------- -# @(#)Makefile 1.1 10/18/96 -# -# Makefile for the simple file test -#---------------------------------------------------------------------------- - -#---------------------------------------------------------------------------- -# Local macros -#---------------------------------------------------------------------------- - -BIN = client - -LSRC = $(addsuffix .cpp,$(BIN)) - -VLDLIBS = $(LDLIBS:%=%$(VAR)) - -BUILD = $(VBIN) - -#---------------------------------------------------------------------------- -# Include macros and targets -#---------------------------------------------------------------------------- - -include $(WRAPPER_ROOT)/include/makeinclude/wrapper_macros.GNU -include $(WRAPPER_ROOT)/include/makeinclude/macros.GNU -include $(WRAPPER_ROOT)/include/makeinclude/rules.common.GNU -include $(WRAPPER_ROOT)/include/makeinclude/rules.nonested.GNU -include $(WRAPPER_ROOT)/include/makeinclude/rules.bin.GNU -include $(WRAPPER_ROOT)/include/makeinclude/rules.local.GNU - -#---------------------------------------------------------------------------- -# Local targets -#---------------------------------------------------------------------------- - -#---------------------------------------------------------------------------- -# Dependencies -#---------------------------------------------------------------------------- -# DO NOT DELETE THIS LINE -- g++dep uses it. -# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. - -.obj/client.o .shobj/client.so: client.cpp \ - $(WRAPPER_ROOT)/ace/OS.h \ - $(WRAPPER_ROOT)/ace/Time_Value.h \ - $(WRAPPER_ROOT)/ace/config.h \ - $(WRAPPER_ROOT)/ace/stdcpp.h \ - $(WRAPPER_ROOT)/ace/Trace.h \ - $(WRAPPER_ROOT)/ace/Log_Msg.h \ - $(WRAPPER_ROOT)/ace/Log_Record.h \ - $(WRAPPER_ROOT)/ace/Log_Priority.h \ - $(WRAPPER_ROOT)/ace/ACE.h \ - $(WRAPPER_ROOT)/ace/ACE.i \ - $(WRAPPER_ROOT)/ace/Log_Record.i \ - $(WRAPPER_ROOT)/ace/FILE_Addr.h \ - $(WRAPPER_ROOT)/ace/Addr.h \ - $(WRAPPER_ROOT)/ace/FILE_Connector.h \ - $(WRAPPER_ROOT)/ace/FILE_IO.h \ - $(WRAPPER_ROOT)/ace/FILE.h \ - $(WRAPPER_ROOT)/ace/IO_SAP.h \ - $(WRAPPER_ROOT)/ace/IO_SAP.i \ - $(WRAPPER_ROOT)/ace/FILE.i \ - $(WRAPPER_ROOT)/ace/FILE_IO.i \ - $(WRAPPER_ROOT)/ace/FILE_Connector.i - -# IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/examples/IPC_SAP/FILE_SAP/client.cpp b/examples/IPC_SAP/FILE_SAP/client.cpp deleted file mode 100644 index 5e103653f3a..00000000000 --- a/examples/IPC_SAP/FILE_SAP/client.cpp +++ /dev/null @@ -1,57 +0,0 @@ -#include "ace/OS.h" -// $Id$ - - -#include "ace/FILE_Addr.h" -#include "ace/FILE_Connector.h" -#include "ace/FILE_IO.h" - -int -main (int argc, char *argv[]) -{ - if (argc < 2) - ACE_ERROR_RETURN ((LM_ERROR, "usage: %s filename string\n", argv[0]), 1); - - char *readback = new char[::strlen (argv[1]) + 1]; - - ACE_FILE_Info fileinfo; - ACE_FILE_IO cli_file; - ACE_FILE_Connector con; - - if (con.connect (cli_file, ACE_FILE_Addr (argv[1]), - 0, ACE_Addr::sap_any, 0, - O_RDWR|O_APPEND|O_CREAT, 0666) == -1) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n to %s", "connect", argv[1]), -1); - - size_t len = ACE_OS::strlen (argv[2]) + 1; - - if (cli_file.send (argv[2], len) != len) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "send"), 1); - - if (cli_file.get_info (&fileinfo) == -1) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "get_info"), 1); - else - cout << "fileinfo : mode = " << (fileinfo.mode_ & 777) - << "\nno of links = " << fileinfo.nlink_ - << "\nsize = " << fileinfo.size_ << endl; - - off_t fpos = cli_file.position (); - - if (fpos == -1) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "position"), 1); - else - cout << "current filepointer is at " << fpos << endl; - - if (cli_file.position (0, SEEK_SET) == -1) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "position"), 1); - - if (cli_file.recv (readback, len) != len) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "recv"), 1); - - cout << "read back :" << readback << endl; - - if (cli_file.close () == -1) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "close"), 1); - - return 0; -} diff --git a/examples/IPC_SAP/FILE_SAP/testfile b/examples/IPC_SAP/FILE_SAP/testfile deleted file mode 100644 index e7cbb71a0d5..00000000000 --- a/examples/IPC_SAP/FILE_SAP/testfile +++ /dev/null @@ -1 +0,0 @@ -testfile
\ No newline at end of file diff --git a/examples/IPC_SAP/Makefile b/examples/IPC_SAP/Makefile deleted file mode 100644 index 8414b8c6201..00000000000 --- a/examples/IPC_SAP/Makefile +++ /dev/null @@ -1,27 +0,0 @@ -#---------------------------------------------------------------------------- -# @(#)Makefile 1.1 10/18/96 -# -# Makefile for the IPC_SAP test directory -#---------------------------------------------------------------------------- - -#---------------------------------------------------------------------------- -# Local macros -#---------------------------------------------------------------------------- - -DIRS = DEV_SAP \ - FIFO_SAP \ - FILE_SAP \ - SOCK_SAP \ - SPIPE_SAP \ - TLI_SAP \ - UPIPE_SAP - -#---------------------------------------------------------------------------- -# macros and targets -#---------------------------------------------------------------------------- - -include $(WRAPPER_ROOT)/include/makeinclude/wrapper_macros.GNU -include $(WRAPPER_ROOT)/include/makeinclude/macros.GNU -include $(WRAPPER_ROOT)/include/makeinclude/rules.common.GNU -include $(WRAPPER_ROOT)/include/makeinclude/rules.nested.GNU -include $(WRAPPER_ROOT)/include/makeinclude/rules.nolocal.GNU diff --git a/examples/IPC_SAP/SOCK_SAP/C-inclient.cpp b/examples/IPC_SAP/SOCK_SAP/C-inclient.cpp deleted file mode 100644 index 049bd51d1e6..00000000000 --- a/examples/IPC_SAP/SOCK_SAP/C-inclient.cpp +++ /dev/null @@ -1,60 +0,0 @@ -#include "ace/OS.h" -// $Id$ - - -/* BSD socket client */ - -int -main (int argc, char *argv[]) -{ - // Initialize WinSock DLL on Win32... - ACE_OS::socket_init (ACE_WSOCK_VERSION); - - struct sockaddr_in saddr; - struct hostent *hp; - char *host = argc > 1 ? argv[1] : ACE_DEFAULT_SERVER_HOST; - u_short port_num = - htons (argc > 2 ? atoi (argv[2]) : ACE_DEFAULT_SERVER_PORT); - char buf[BUFSIZ]; - ACE_HANDLE s_handle; - int w_bytes; - int r_bytes; - int n; - - // Create a local endpoint of communication. - if ((s_handle = ACE_OS::socket (PF_INET, SOCK_STREAM, 0)) == ACE_INVALID_HANDLE) - ACE_OS::perror ("socket"), ACE_OS::exit (1); - - // Determine IP address of the server. - if ((hp = ACE_OS::gethostbyname (host)) == 0) - ACE_OS::perror ("gethostbyname"), ACE_OS::exit (1); - - // Set up the address information to contact the server. - ACE_OS::memset ((void *) &saddr, 0, sizeof saddr); - saddr.sin_family = AF_INET; - saddr.sin_port = port_num; - ACE_OS::memcpy (&saddr.sin_addr, hp->h_addr, hp->h_length); - - // Establish connection with remote server. - if (ACE_OS::connect (s_handle, (struct sockaddr *) &saddr, - sizeof saddr) == -1) - ACE_OS::perror ("connect"), ACE_OS::exit (1); - - // Send data to server (correctly handles "incomplete writes" due to - // flow control). - - while ((r_bytes = ACE_OS::read (ACE_STDIN, buf, sizeof buf)) > 0) - for (w_bytes = 0; w_bytes < r_bytes; w_bytes += n) - if ((n = ACE_OS::send (s_handle, buf + w_bytes, - r_bytes - w_bytes)) < 0) - ACE_OS::perror ("write"), ACE_OS::exit (1); - - if (ACE_OS::recv (s_handle, buf, 1) == 1) - ACE_OS::write (ACE_STDOUT, buf, 1); - - // Explicitly close the connection. - if (ACE_OS::closesocket (s_handle) == -1) - ACE_OS::perror ("close"), ACE_OS::exit (1); - - return 0; -} diff --git a/examples/IPC_SAP/SOCK_SAP/C-inserver.cpp b/examples/IPC_SAP/SOCK_SAP/C-inserver.cpp deleted file mode 100644 index e2a0c0cca94..00000000000 --- a/examples/IPC_SAP/SOCK_SAP/C-inserver.cpp +++ /dev/null @@ -1,84 +0,0 @@ -#include "ace/OS.h" -// $Id$ - - -/* BSD socket server. */ - -int main (int argc, char *argv[]) -{ - // Initialize WinSock DLL on Win32... - ACE_OS::socket_init (ACE_WSOCK_VERSION); - - u_short port_num = - htons (argc > 1 ? ACE_OS::atoi (argv[1]) : ACE_DEFAULT_SERVER_PORT); - struct sockaddr_in saddr; - ACE_HANDLE s_handle, n_handle; - - /* Create a local endpoint of communication */ - if ((s_handle = ACE_OS::socket (PF_INET, SOCK_STREAM, 0)) == ACE_INVALID_HANDLE) - ACE_OS::perror ("socket"), ACE_OS::exit (1); - - /* Set up the address information to become a server */ - ACE_OS::memset ((void *) &saddr, 0, sizeof saddr); - saddr.sin_family = AF_INET; - saddr.sin_port = port_num; - saddr.sin_addr.s_addr = INADDR_ANY; - - /* Associate address with endpoint */ - if (ACE_OS::bind (s_handle, (struct sockaddr *) &saddr, - sizeof saddr) == -1) - ACE_OS::perror ("bind"), ACE_OS::exit (1); - - /* Make endpoint listen for service requests */ - if (ACE_OS::listen (s_handle, 5) == -1) - ACE_OS::perror ("listen"), ACE_OS::exit (1); - - /* Performs the iterative server activities */ - - for (;;) - { - char buf[BUFSIZ]; - int r_bytes; - struct sockaddr_in cli_addr; - int cli_addr_len = sizeof cli_addr; - struct hostent *hp; - - /* Create a new endpoint of communication */ - do - n_handle = ACE_OS::accept (s_handle, (struct sockaddr *) - &cli_addr, &cli_addr_len); - while (n_handle == ACE_INVALID_HANDLE && errno == EINTR); - - if (n_handle == ACE_INVALID_HANDLE) - { - ACE_OS::perror ("accept"); - continue; - } - - int addr_len = sizeof cli_addr.sin_addr.s_addr; - hp = ACE_OS::gethostbyaddr ((char *) &cli_addr.sin_addr, - addr_len, AF_INET); - - if (hp != 0) - ACE_OS::printf ("client %s\n", hp->h_name), ACE_OS::fflush (stdout); - else - ACE_OS::perror ("gethostbyaddr"); - - /* Read data from client (terminate on error) */ - - while ((r_bytes = ACE_OS::recv (n_handle, buf, sizeof buf)) > 0) - if (ACE_OS::write (ACE_STDOUT, buf, r_bytes) != r_bytes) - ACE_OS::perror ("write"), ACE_OS::exit (1); - - if (ACE_OS::send (n_handle, "", 1) != 1) - ::perror ("write"), ACE_OS::exit (1); - - /* Close the new endpoint - (listening endpoint remains open) */ - if (ACE_OS::closesocket (n_handle) == -1) - ACE_OS::perror ("close"), ACE_OS::exit (1); - ACE_OS::exit (0); - } - /* NOTREACHED */ - return 0; -} diff --git a/examples/IPC_SAP/SOCK_SAP/CPP-inclient.cpp b/examples/IPC_SAP/SOCK_SAP/CPP-inclient.cpp deleted file mode 100644 index de2d0b1f6cb..00000000000 --- a/examples/IPC_SAP/SOCK_SAP/CPP-inclient.cpp +++ /dev/null @@ -1,86 +0,0 @@ -// $Id$ - -// This tests the non-blocking features of the ACE_SOCK_Connector -// class. - -#include "ace/SOCK_Connector.h" -#include "ace/INET_Addr.h" - -// ACE SOCK_SAP client. - -int main (int argc, char *argv[]) -{ - char *host = argc > 1 ? argv[1] : ACE_DEFAULT_SERVER_HOST; - u_short r_port = argc > 2 ? ACE_OS::atoi (argv[2]) : ACE_DEFAULT_SERVER_PORT; - ACE_Time_Value timeout (argc > 3 ? ACE_OS::atoi (argv[3]) : ACE_DEFAULT_TIMEOUT); - char buf[BUFSIZ]; - - ACE_SOCK_Stream cli_stream; - ACE_INET_Addr remote_addr (r_port, host); - - ACE_SOCK_Connector con; - - // Attempt a non-blocking connect to the server, reusing the local - // addr if necessary. -#if defined (VXWORKS) - // Initiate blocking connection with server. - ACE_DEBUG ((LM_DEBUG, "starting connect\n")); - - if (con.connect (cli_stream, remote_addr) == -1) -#else - // Initiate timed, non-blocking connection with server. - ACE_DEBUG ((LM_DEBUG, "starting non-blocking connect\n")); - - if (con.connect (cli_stream, remote_addr, (ACE_Time_Value *) &ACE_Time_Value::zero) == -1) -#endif /* VXWORKS */ - { - if (errno != EWOULDBLOCK) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "connection failed"), 1); - - ACE_DEBUG ((LM_DEBUG, "starting timed connect\n")); - -#if !defined (VXWORKS) - // Check if non-blocking connection is in progress, - // and wait up to timeout seconds for it to complete. - - if (con.complete (cli_stream, &remote_addr, &timeout) == -1) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "complete failed"), 1); - else - ACE_DEBUG ((LM_DEBUG, "connected to %s\n", remote_addr.get_host_name ())); -#endif /* !VXWORKS */ - } - -#if !defined (VXWORKS) - if (cli_stream.disable (ACE_NONBLOCK) == -1) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "disable"), 1); -#endif /* !VXWORKS */ - - // Send data to server (correctly handles "incomplete writes"). - - for (ssize_t r_bytes; - (r_bytes = ACE_OS::read (ACE_STDIN, buf, sizeof buf)) > 0; ) - if (ACE_OS::strcmp (buf, "quit\n") == 0) - break; - else if (cli_stream.send (buf, r_bytes, 0, &timeout) == -1) - { - if (errno == ETIME) - ACE_DEBUG ((LM_DEBUG, "%p\n", "send_n")); - else - // Breakout if we didn't fail due to a timeout. - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "send_n"), -1); - } - - // Explicitly close the writer-side of the connection. - if (cli_stream.close_writer () == -1) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "close_writer"), 1); - - // Wait for handshake with server. - if (cli_stream.recv_n (buf, 1) != 1) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "recv_n"), 1); - - // Close the connection completely. - if (cli_stream.close () == -1) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "close"), 1); - - return 0; -} diff --git a/examples/IPC_SAP/SOCK_SAP/CPP-inserver-poll.cpp b/examples/IPC_SAP/SOCK_SAP/CPP-inserver-poll.cpp deleted file mode 100644 index 9ba1fa02ad4..00000000000 --- a/examples/IPC_SAP/SOCK_SAP/CPP-inserver-poll.cpp +++ /dev/null @@ -1,101 +0,0 @@ -// IPC_SAP/poll server, which illustrates how to integrate the ACE -// $Id$ - -// socket wrappers with the SVR4 poll() system call to create a -// single-threaded concurrent server. - -#include "ace/SOCK_Acceptor.h" -#include "ace/SOCK_Stream.h" -#include "ace/INET_Addr.h" - -#if defined (ACE_HAS_SVR4_POLL) - -// Maximum per-process open I/O descriptors. -const int MAX_FDS = 200; - -int -main (void) -{ - // Create a server end-point. - ACE_INET_Addr addr (ACE_DEFAULT_SERVER_PORT); - ACE_SOCK_Acceptor peer_acceptor (addr); - ACE_SOCK_Stream new_stream; - ACE_HANDLE s_handle = peer_acceptor.get_handle (); - struct pollfd poll_array[MAX_FDS]; - - for (int i = 0; i < MAX_FDS; i++) - { - poll_array[i].fd = ACE::INVALID_HANDLE; - poll_array[i].events = POLLIN; - } - - poll_array[0].fd = s_handle; - - for (int n_handles = 1;;) - { - // Wait for client I/O events (handle interrupts). - while (ACE_OS::poll (poll_array, n_handles) == -1 - && errno == EINTR) - continue; - - // Handle pending logging messages first (s_handle + 1 is - // guaranteed to be lowest client descriptor). - - for (i = 1; i < n_handles; i++) - { - if (poll_array[i].revents & POLLIN) - { - char buf[BUFSIZ]; - int n; - // recv will not block in this case! - if ((n = ACE_OS::recv (poll_array[i].fd, buf, sizeof buf, 0)) == -1) - ACE_OS::perror ("read failed"); - else if (n == 0) - { - // Handle client connection shutdown. - if (ACE_OS::close (poll_array[i].fd) == -1) - ACE_OS::perror ("close"); - poll_array[i].fd = poll_array[--n_handles].fd; - - // Send handshake back to client to unblock it. - if (ACE_OS::send (poll_array[i].fd, "", 1) != 1) - ACE_ERROR ((LM_ERROR, "%p\n", "send_n")); - } - else - ACE_OS::printf ("%*s", n, buf), fflush (stdout); - } - ACE_OS::fflush (stdout); - } - if (poll_array[0].revents & POLLIN) - { - ACE_INET_Addr client; - ACE_Time_Value nonblock (0, 0); - - // Handle all pending connection requests (note use of - // "polling" feature that doesn't block). - - while (ACE_OS::poll (poll_array, 1, nonblock) > 0) - if (peer_acceptor.accept (new_stream, &client) == -1) - ACE_OS::perror ("accept"); - else - { - const char *s = client.get_host_name (); - - ACE_ASSERT (s != 0); - ACE_OS::printf ("client %s\n", s); - ACE_OS::fflush (stdout); - poll_array[n_handles++].fd = new_stream.get_handle (); - } - } - } - /* NOTREACHED */ - return 0; -} -#else -#include <stdio.h> -int main (void) -{ - ACE_OS::fprintf (stderr, "This feature is not supported\n"); - return 0; -} -#endif /* ACE_HAS_SVR4_POLL */ diff --git a/examples/IPC_SAP/SOCK_SAP/CPP-inserver.cpp b/examples/IPC_SAP/SOCK_SAP/CPP-inserver.cpp deleted file mode 100644 index 313d1c683b6..00000000000 --- a/examples/IPC_SAP/SOCK_SAP/CPP-inserver.cpp +++ /dev/null @@ -1,150 +0,0 @@ -// This example tests the non-blocking features of the -// ACE_SOCK_Acceptor and ACE_SOCK_Stream classes. -// $Id$ - - -#include "ace/SOCK_Acceptor.h" -#include "ace/SOCK_Stream.h" -#include "ace/INET_Addr.h" -#include "ace/Handle_Set.h" - -// ACE SOCK_SAP server. - -int -main (int argc, char *argv[]) -{ - u_short port = argc > 1 - ? ACE_OS::atoi (argv[1]) - : ACE_DEFAULT_SERVER_PORT; - ACE_Time_Value timeout (argc > 2 - ? ACE_OS::atoi (argv[2]) - : ACE_DEFAULT_TIMEOUT); - int sleep_time = argc > 3 ? ACE_OS::atoi (argv[3]) : 0; - - ACE_SOCK_Acceptor peer_acceptor; - - // Create a server address. - ACE_INET_Addr server_addr (port); - - // Create a server, reuse the address. - if (peer_acceptor.open (server_addr, 1) == -1) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "open"), 1); -#if !defined(VXWORKS) - // Set the peer acceptor into non-blocking mode. - else if (peer_acceptor.enable (ACE_NONBLOCK) == -1) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "enable"), 1); -#endif /* !VXWORKS */ - else if (peer_acceptor.get_local_addr (server_addr) == -1) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "get_local_addr"), 1); - - ACE_DEBUG ((LM_DEBUG, "starting server at port %d\n", - server_addr.get_port_number ())); - - // Keep these objects out here to prevent excessive constructor - // calls within the loop. - ACE_SOCK_Stream new_stream; - ACE_INET_Addr cli_addr; - ACE_Handle_Set handle_set; - - // Performs the iterative server activities. - - for (;;) - { - char buf[BUFSIZ]; - - handle_set.reset (); - handle_set.set_bit (peer_acceptor.get_handle ()); - - int result = ACE_OS::select (int (peer_acceptor.get_handle ()) + 1, - handle_set, - 0, 0, timeout); - if (result == -1) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "select"), -1); - else if (result == 0) - ACE_DEBUG ((LM_DEBUG, "select timed out\n")); - else - { - // Create a new ACE_SOCK_Stream endpoint (note automatic restart - // if errno == EINTR). - - while ((result = peer_acceptor.accept (new_stream, &cli_addr)) != -1) - { - ACE_DEBUG ((LM_DEBUG, "client %s connected from %d\n", - cli_addr.get_host_name (), cli_addr.get_port_number ())); - -#if !defined(VXWORKS) - // Enable non-blocking I/O. - if (new_stream.enable (ACE_NONBLOCK) == -1) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "enable"), -1); -#endif /* !VXWORKS */ - - handle_set.reset (); - handle_set.set_bit (new_stream.get_handle ()); - - // Read data from client (terminate on error). - - for (ssize_t r_bytes;;) - { - // Wait to read until there's something from the client. - if (ACE_OS::select (int (new_stream.get_handle ()) + 1, - handle_set, - 0, 0, timeout) == -1) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "select"), -1); - - // Keep reading until the client shuts down. - for (;;) - { - // Sleep for some amount of time in order to - // test client flow control. - ACE_OS::sleep (sleep_time); - - r_bytes = new_stream.recv (buf, sizeof buf, 0, &timeout); - - if (r_bytes <= 0) - { - if (errno == ETIME) - ACE_ERROR ((LM_ERROR, "%p\n", "ACE::recv")); - break; - } - else if (ACE::write_n (ACE_STDOUT, buf, r_bytes) != r_bytes) - ACE_ERROR ((LM_ERROR, "%p\n", "ACE::send_n")); - } - - if (r_bytes == 0) - { - ACE_DEBUG ((LM_DEBUG, - "reached end of input, connection closed by client\n")); - - // Send handshake back to client to unblock it. - if (new_stream.send_n ("", 1) != 1) - ACE_ERROR ((LM_ERROR, "%p\n", "send_n")); - break; - } - else if (r_bytes == -1) - { - if (errno == EWOULDBLOCK || errno == ETIME) - ACE_DEBUG ((LM_DEBUG, - "no input available, going back to reading\n")); - else - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "recv"), -1); - } - } - - // Close new endpoint (listening endpoint stays open). - if (new_stream.close () == -1) - ACE_ERROR ((LM_ERROR, "%p\n", "close")); - } - - if (result == -1) - { - if (errno == EWOULDBLOCK) - ACE_DEBUG ((LM_DEBUG, - "no connections available, going back to accepting\n")); - else - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "ACE::write"), -1); - } - } - } - /* NOTREACHED */ - return 0; -} diff --git a/examples/IPC_SAP/SOCK_SAP/CPP-unclient.cpp b/examples/IPC_SAP/SOCK_SAP/CPP-unclient.cpp deleted file mode 100644 index 41a1c5db682..00000000000 --- a/examples/IPC_SAP/SOCK_SAP/CPP-unclient.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/* ACE_LSOCK Client */ -// $Id$ - - - -#include "ace/LSOCK_Connector.h" -#include "ace/UNIX_Addr.h" - -#if !defined (ACE_LACKS_UNIX_DOMAIN_SOCKETS) - -int -main (int argc, char *argv[]) -{ - char *rendezvous = argc > 1 ? argv[1] : ACE_DEFAULT_RENDEZVOUS; - char buf[BUFSIZ]; - - ACE_LSOCK_Stream cli_stream; - ACE_LSOCK_Connector con; - - /* Establish the connection with server */ - if (con.connect (cli_stream, ACE_UNIX_Addr (rendezvous)) == -1) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "connect"), 1); - - /* Send data to server (correctly handles "incomplete writes") */ - - for (int r_bytes; (r_bytes = ACE_OS::read (ACE_STDIN, buf, sizeof buf)) > 0; ) - if (cli_stream.send_n (buf, r_bytes) == -1) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "send_n"), 1); - - /* Explicitly close the writer-side of the connection. */ - if (cli_stream.close_writer () == -1) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "close_writer"), 1); - - /* Wait for handshake with server. */ - if (cli_stream.recv_n (buf, 1) != 1) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "recv_n"), 1); - - /* Close the connection completely. */ - if (cli_stream.close () == -1) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "close"), 1); - - return 0; -} -#else -int main (void) -{ - ACE_ERROR_RETURN ((LM_ERROR, - "this platform does not support UNIX-domain sockets\n"), -1); -} -#endif /* ACE_LACKS_UNIX_DOMAIN_SOCKETS */ diff --git a/examples/IPC_SAP/SOCK_SAP/CPP-unserver.cpp b/examples/IPC_SAP/SOCK_SAP/CPP-unserver.cpp deleted file mode 100644 index 25ecf7aa8cd..00000000000 --- a/examples/IPC_SAP/SOCK_SAP/CPP-unserver.cpp +++ /dev/null @@ -1,78 +0,0 @@ -/* ACE_LSOCK Server */ -// $Id$ - - - -#include "ace/LSOCK_Acceptor.h" -#include "ace/LSOCK_Stream.h" -#include "ace/UNIX_Addr.h" - -#if !defined (ACE_LACKS_UNIX_DOMAIN_SOCKETS) - -int -main (int argc, char *argv[]) -{ - char *rendezvous = argc > 1 ? argv[1] : ACE_DEFAULT_RENDEZVOUS; - - /* Create a server address. */ - ACE_UNIX_Addr server_addr (rendezvous); - - ACE_LSOCK_Acceptor peer_acceptor; - - /* Create a server */ - - if (peer_acceptor.open (server_addr) == -1) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "open"), 1); - - /* Keep these guys out here to prevent excessive constructor - calls... */ - ACE_LSOCK_Stream new_stream; - ACE_UNIX_Addr cli_addr; - - ACE_DEBUG ((LM_DEBUG, "starting server %s\n", - server_addr.get_path_name ())); - - /* Performs the iterative server activities */ - - for (;;) - { - char buf[BUFSIZ]; - ACE_Time_Value timeout (ACE_DEFAULT_TIMEOUT); - - /* Create a new ACE_SOCK_Stream endpoint (note - automatic restart if errno == EINTR) */ - - if (peer_acceptor.accept (new_stream, &cli_addr, &timeout) == -1) - { - ACE_ERROR ((LM_ERROR, "%p\n", "accept")); - continue; - } - - ACE_DEBUG ((LM_DEBUG, "client %s\n", - cli_addr.get_path_name ())); - - /* Read data from client (terminate on error) */ - - for (int r_bytes; - (r_bytes = new_stream.recv (buf, sizeof buf)) > 0; ) - if (ACE_OS::write (ACE_STDOUT, buf, r_bytes) != r_bytes) - ACE_ERROR ((LM_ERROR, "%p\n", "ACE::send_n")); - - if (new_stream.send_n ("", 1) != 1) - ACE_ERROR ((LM_ERROR, "%p\n", "send_n")); - - /* Close new endpoint (listening endpoint stays open) */ - if (new_stream.close () == -1) - ACE_ERROR ((LM_ERROR, "%p\n", "close")); - } - - /* NOTREACHED */ - return 0; -} -#else -int main (void) -{ - ACE_ERROR_RETURN ((LM_ERROR, - "this platform does not support UNIX-domain sockets\n"), -1); -} -#endif /* ACE_LACKS_UNIX_DOMAIN_SOCKETS */ diff --git a/examples/IPC_SAP/SOCK_SAP/FD-unclient.cpp b/examples/IPC_SAP/SOCK_SAP/FD-unclient.cpp deleted file mode 100644 index 2165064ab83..00000000000 --- a/examples/IPC_SAP/SOCK_SAP/FD-unclient.cpp +++ /dev/null @@ -1,50 +0,0 @@ -// $Id$ - -#include "ace/LSOCK_Connector.h" -#include "ace/UNIX_Addr.h" - -#if defined (ACE_HAS_MSG) && !defined (ACE_HAS_UNIX_DOMAIN_SOCKETS) -// ACE_LSOCK Client. - -int -main (int argc, char *argv[]) -{ - char *file_name = argc > 1 ? argv[1] : "./local_data"; - char *rendezvous = argc > 2 ? argv[2] : ACE_DEFAULT_RENDEZVOUS; - ACE_HANDLE handle; - int n; - char buf[BUFSIZ]; - - ACE_LSOCK_Stream cli_stream; - ACE_UNIX_Addr addr (rendezvous); - - // Establish the connection with server. - ACE_LSOCK_Connector connector; - - if (connector.connect (cli_stream, addr) == -1) - ACE_OS::perror ("connect"), ACE_OS::exit (1); - - if ((handle = ACE_OS::open (file_name, O_RDONLY)) == -1) - ACE_OS::perror ("open"), ACE_OS::exit (1); - - // Send handle to server (correctly handles incomplete writes). - if (cli_stream.send_handle (handle) == -1) - ACE_OS::perror ("send"), ACE_OS::exit (1); - - if ((n = cli_stream.recv_n (buf, sizeof buf)) == -1) - ACE_OS::perror ("recv"), ACE_OS::exit (1); - else - ACE_OS::write (ACE_STDOUT, buf, n); - - // Explicitly close the connection. - if (cli_stream.close () == -1) - ACE_OS::perror ("close"), ACE_OS::exit (1); - - return 0; -} -#else -int main (void) -{ - ACE_ERROR_RETURN ((LM_ERROR, "your platform must support sendmsg/recvmsg to run this test\n"), -1); -} -#endif /* ACE_HAS_MSG */ diff --git a/examples/IPC_SAP/SOCK_SAP/FD-unserver.cpp b/examples/IPC_SAP/SOCK_SAP/FD-unserver.cpp deleted file mode 100644 index 38cf2b9de8c..00000000000 --- a/examples/IPC_SAP/SOCK_SAP/FD-unserver.cpp +++ /dev/null @@ -1,61 +0,0 @@ -// $Id$ - -#include "ace/LSOCK_Acceptor.h" -#include "ace/LSOCK_Stream.h" -#include "ace/UNIX_Addr.h" - -#if !defined (ACE_LACKS_UNIX_DOMAIN_SOCKETS) - -// ACE_LSOCK Server - -int -main (int argc, char *argv[]) -{ - char *rendezvous = argc > 1 ? argv[1] : ACE_DEFAULT_RENDEZVOUS; - // Create a server. - ACE_OS::unlink (rendezvous); - ACE_UNIX_Addr addr (rendezvous); - ACE_LSOCK_Acceptor peer_acceptor (addr); - ACE_LSOCK_Stream new_stream; - - // Performs the iterative server activities. - - for (;;) - { - char buf[BUFSIZ]; - ACE_HANDLE handle; - - // Create a new ACE_SOCK_Stream endpoint. - if (peer_acceptor.accept (new_stream) == -1) - ACE_OS::perror ("accept"); - - // Read data from client (correctly handles incomplete reads due - // to flow control). - - if (new_stream.recv_handle (handle) == -1) - ACE_OS::perror ("recv_handle"), ACE_OS::exit (1); - - ACE_OS::puts ("----------------------------------------"); - - for (int n; (n = ACE_OS::read (handle, buf, sizeof buf)) > 0; ) - ACE_OS::write (ACE_STDOUT, buf, n); - - ACE_OS::puts ("----------------------------------------"); - - if (new_stream.send ("yow", 3) == -1) - ACE_OS::perror ("send"), ACE_OS::exit (1); - - // Close new endpoint (listening endpoint stays open). - if (new_stream.close () == -1) - ACE_OS::perror ("close"); - } - /* NOTREACHED */ - return 0; -} -#else -int -main (void) -{ - ACE_ERROR_RETURN ((LM_ERROR, "your platform doesn't not support UNIX domain sockets\n"), -1); -} -#endif /* ACE_LACKS_UNIX_DOMAIN_SOCKETS */ diff --git a/examples/IPC_SAP/SOCK_SAP/Makefile b/examples/IPC_SAP/SOCK_SAP/Makefile deleted file mode 100644 index 75eebdece96..00000000000 --- a/examples/IPC_SAP/SOCK_SAP/Makefile +++ /dev/null @@ -1,267 +0,0 @@ -#---------------------------------------------------------------------------- -# @(#)Makefile 1.1 10/18/96 -# -# Makefile for IPC_SAP test -#---------------------------------------------------------------------------- - -#---------------------------------------------------------------------------- -# Local macros -#---------------------------------------------------------------------------- - -INFO = README - -BIN = CPP-inclient \ - CPP-unclient \ - CPP-inserver \ - CPP-inserver-poll \ - CPP-unserver \ - FD-unclient \ - FD-unserver \ - C-inclient \ - C-inserver - -LSRC = $(addsuffix .cpp,$(BIN)) - -VLDLIBS = $(LDLIBS:%=%$(VAR)) - -BUILD = $(VBIN) - -#---------------------------------------------------------------------------- -# Include macros and targets -#---------------------------------------------------------------------------- - -include $(WRAPPER_ROOT)/include/makeinclude/wrapper_macros.GNU -include $(WRAPPER_ROOT)/include/makeinclude/macros.GNU -include $(WRAPPER_ROOT)/include/makeinclude/rules.common.GNU -include $(WRAPPER_ROOT)/include/makeinclude/rules.nonested.GNU -include $(WRAPPER_ROOT)/include/makeinclude/rules.bin.GNU -include $(WRAPPER_ROOT)/include/makeinclude/rules.local.GNU - -#---------------------------------------------------------------------------- -# Local targets -#---------------------------------------------------------------------------- - -#---------------------------------------------------------------------------- -# Dependencies -#---------------------------------------------------------------------------- - -# DO NOT DELETE THIS LINE -- g++dep uses it. -# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. - -.obj/CPP-inclient.o .shobj/CPP-inclient.so: CPP-inclient.cpp \ - $(WRAPPER_ROOT)/ace/SOCK_Connector.h \ - $(WRAPPER_ROOT)/ace/SOCK_Stream.h \ - $(WRAPPER_ROOT)/ace/SOCK_IO.h \ - $(WRAPPER_ROOT)/ace/SOCK.h \ - $(WRAPPER_ROOT)/ace/ACE.h \ - $(WRAPPER_ROOT)/ace/OS.h \ - $(WRAPPER_ROOT)/ace/Time_Value.h \ - $(WRAPPER_ROOT)/ace/config.h \ - $(WRAPPER_ROOT)/ace/stdcpp.h \ - $(WRAPPER_ROOT)/ace/Trace.h \ - $(WRAPPER_ROOT)/ace/Log_Msg.h \ - $(WRAPPER_ROOT)/ace/Log_Record.h \ - $(WRAPPER_ROOT)/ace/Log_Priority.h \ - $(WRAPPER_ROOT)/ace/Log_Record.i \ - $(WRAPPER_ROOT)/ace/ACE.i \ - $(WRAPPER_ROOT)/ace/Addr.h \ - $(WRAPPER_ROOT)/ace/IPC_SAP.h \ - $(WRAPPER_ROOT)/ace/IPC_SAP.i \ - $(WRAPPER_ROOT)/ace/SOCK.i \ - $(WRAPPER_ROOT)/ace/SOCK_IO.i \ - $(WRAPPER_ROOT)/ace/INET_Addr.h \ - $(WRAPPER_ROOT)/ace/SOCK_Stream.i \ - $(WRAPPER_ROOT)/ace/SOCK_Connector.i -.obj/CPP-unclient.o .shobj/CPP-unclient.so: CPP-unclient.cpp \ - $(WRAPPER_ROOT)/ace/LSOCK_Connector.h \ - $(WRAPPER_ROOT)/ace/SOCK_Connector.h \ - $(WRAPPER_ROOT)/ace/SOCK_Stream.h \ - $(WRAPPER_ROOT)/ace/SOCK_IO.h \ - $(WRAPPER_ROOT)/ace/SOCK.h \ - $(WRAPPER_ROOT)/ace/ACE.h \ - $(WRAPPER_ROOT)/ace/OS.h \ - $(WRAPPER_ROOT)/ace/Time_Value.h \ - $(WRAPPER_ROOT)/ace/config.h \ - $(WRAPPER_ROOT)/ace/stdcpp.h \ - $(WRAPPER_ROOT)/ace/Trace.h \ - $(WRAPPER_ROOT)/ace/Log_Msg.h \ - $(WRAPPER_ROOT)/ace/Log_Record.h \ - $(WRAPPER_ROOT)/ace/Log_Priority.h \ - $(WRAPPER_ROOT)/ace/Log_Record.i \ - $(WRAPPER_ROOT)/ace/ACE.i \ - $(WRAPPER_ROOT)/ace/Addr.h \ - $(WRAPPER_ROOT)/ace/IPC_SAP.h \ - $(WRAPPER_ROOT)/ace/IPC_SAP.i \ - $(WRAPPER_ROOT)/ace/SOCK.i \ - $(WRAPPER_ROOT)/ace/SOCK_IO.i \ - $(WRAPPER_ROOT)/ace/INET_Addr.h \ - $(WRAPPER_ROOT)/ace/SOCK_Stream.i \ - $(WRAPPER_ROOT)/ace/SOCK_Connector.i \ - $(WRAPPER_ROOT)/ace/LSOCK_Stream.h \ - $(WRAPPER_ROOT)/ace/LSOCK.h \ - $(WRAPPER_ROOT)/ace/LSOCK.i \ - $(WRAPPER_ROOT)/ace/LSOCK_Stream.i \ - $(WRAPPER_ROOT)/ace/UNIX_Addr.h \ - $(WRAPPER_ROOT)/ace/LSOCK_Connector.i -.obj/CPP-inserver.o .shobj/CPP-inserver.so: CPP-inserver.cpp \ - $(WRAPPER_ROOT)/ace/SOCK_Acceptor.h \ - $(WRAPPER_ROOT)/ace/SOCK_Stream.h \ - $(WRAPPER_ROOT)/ace/SOCK_IO.h \ - $(WRAPPER_ROOT)/ace/SOCK.h \ - $(WRAPPER_ROOT)/ace/ACE.h \ - $(WRAPPER_ROOT)/ace/OS.h \ - $(WRAPPER_ROOT)/ace/Time_Value.h \ - $(WRAPPER_ROOT)/ace/config.h \ - $(WRAPPER_ROOT)/ace/stdcpp.h \ - $(WRAPPER_ROOT)/ace/Trace.h \ - $(WRAPPER_ROOT)/ace/Log_Msg.h \ - $(WRAPPER_ROOT)/ace/Log_Record.h \ - $(WRAPPER_ROOT)/ace/Log_Priority.h \ - $(WRAPPER_ROOT)/ace/Log_Record.i \ - $(WRAPPER_ROOT)/ace/ACE.i \ - $(WRAPPER_ROOT)/ace/Addr.h \ - $(WRAPPER_ROOT)/ace/IPC_SAP.h \ - $(WRAPPER_ROOT)/ace/IPC_SAP.i \ - $(WRAPPER_ROOT)/ace/SOCK.i \ - $(WRAPPER_ROOT)/ace/SOCK_IO.i \ - $(WRAPPER_ROOT)/ace/INET_Addr.h \ - $(WRAPPER_ROOT)/ace/SOCK_Stream.i \ - $(WRAPPER_ROOT)/ace/Handle_Set.h -.obj/CPP-inserver-poll.o .shobj/CPP-inserver-poll.so: CPP-inserver-poll.cpp \ - $(WRAPPER_ROOT)/ace/SOCK_Acceptor.h \ - $(WRAPPER_ROOT)/ace/SOCK_Stream.h \ - $(WRAPPER_ROOT)/ace/SOCK_IO.h \ - $(WRAPPER_ROOT)/ace/SOCK.h \ - $(WRAPPER_ROOT)/ace/ACE.h \ - $(WRAPPER_ROOT)/ace/OS.h \ - $(WRAPPER_ROOT)/ace/Time_Value.h \ - $(WRAPPER_ROOT)/ace/config.h \ - $(WRAPPER_ROOT)/ace/stdcpp.h \ - $(WRAPPER_ROOT)/ace/Trace.h \ - $(WRAPPER_ROOT)/ace/Log_Msg.h \ - $(WRAPPER_ROOT)/ace/Log_Record.h \ - $(WRAPPER_ROOT)/ace/Log_Priority.h \ - $(WRAPPER_ROOT)/ace/Log_Record.i \ - $(WRAPPER_ROOT)/ace/ACE.i \ - $(WRAPPER_ROOT)/ace/Addr.h \ - $(WRAPPER_ROOT)/ace/IPC_SAP.h \ - $(WRAPPER_ROOT)/ace/IPC_SAP.i \ - $(WRAPPER_ROOT)/ace/SOCK.i \ - $(WRAPPER_ROOT)/ace/SOCK_IO.i \ - $(WRAPPER_ROOT)/ace/INET_Addr.h \ - $(WRAPPER_ROOT)/ace/SOCK_Stream.i -.obj/CPP-unserver.o .shobj/CPP-unserver.so: CPP-unserver.cpp \ - $(WRAPPER_ROOT)/ace/LSOCK_Acceptor.h \ - $(WRAPPER_ROOT)/ace/SOCK_Acceptor.h \ - $(WRAPPER_ROOT)/ace/SOCK_Stream.h \ - $(WRAPPER_ROOT)/ace/SOCK_IO.h \ - $(WRAPPER_ROOT)/ace/SOCK.h \ - $(WRAPPER_ROOT)/ace/ACE.h \ - $(WRAPPER_ROOT)/ace/OS.h \ - $(WRAPPER_ROOT)/ace/Time_Value.h \ - $(WRAPPER_ROOT)/ace/config.h \ - $(WRAPPER_ROOT)/ace/stdcpp.h \ - $(WRAPPER_ROOT)/ace/Trace.h \ - $(WRAPPER_ROOT)/ace/Log_Msg.h \ - $(WRAPPER_ROOT)/ace/Log_Record.h \ - $(WRAPPER_ROOT)/ace/Log_Priority.h \ - $(WRAPPER_ROOT)/ace/Log_Record.i \ - $(WRAPPER_ROOT)/ace/ACE.i \ - $(WRAPPER_ROOT)/ace/Addr.h \ - $(WRAPPER_ROOT)/ace/IPC_SAP.h \ - $(WRAPPER_ROOT)/ace/IPC_SAP.i \ - $(WRAPPER_ROOT)/ace/SOCK.i \ - $(WRAPPER_ROOT)/ace/SOCK_IO.i \ - $(WRAPPER_ROOT)/ace/INET_Addr.h \ - $(WRAPPER_ROOT)/ace/SOCK_Stream.i \ - $(WRAPPER_ROOT)/ace/UNIX_Addr.h \ - $(WRAPPER_ROOT)/ace/LSOCK_Stream.h \ - $(WRAPPER_ROOT)/ace/LSOCK.h \ - $(WRAPPER_ROOT)/ace/LSOCK.i \ - $(WRAPPER_ROOT)/ace/LSOCK_Stream.i -.obj/FD-unclient.o .shobj/FD-unclient.so: FD-unclient.cpp \ - $(WRAPPER_ROOT)/ace/LSOCK_Connector.h \ - $(WRAPPER_ROOT)/ace/SOCK_Connector.h \ - $(WRAPPER_ROOT)/ace/SOCK_Stream.h \ - $(WRAPPER_ROOT)/ace/SOCK_IO.h \ - $(WRAPPER_ROOT)/ace/SOCK.h \ - $(WRAPPER_ROOT)/ace/ACE.h \ - $(WRAPPER_ROOT)/ace/OS.h \ - $(WRAPPER_ROOT)/ace/Time_Value.h \ - $(WRAPPER_ROOT)/ace/config.h \ - $(WRAPPER_ROOT)/ace/stdcpp.h \ - $(WRAPPER_ROOT)/ace/Trace.h \ - $(WRAPPER_ROOT)/ace/Log_Msg.h \ - $(WRAPPER_ROOT)/ace/Log_Record.h \ - $(WRAPPER_ROOT)/ace/Log_Priority.h \ - $(WRAPPER_ROOT)/ace/Log_Record.i \ - $(WRAPPER_ROOT)/ace/ACE.i \ - $(WRAPPER_ROOT)/ace/Addr.h \ - $(WRAPPER_ROOT)/ace/IPC_SAP.h \ - $(WRAPPER_ROOT)/ace/IPC_SAP.i \ - $(WRAPPER_ROOT)/ace/SOCK.i \ - $(WRAPPER_ROOT)/ace/SOCK_IO.i \ - $(WRAPPER_ROOT)/ace/INET_Addr.h \ - $(WRAPPER_ROOT)/ace/SOCK_Stream.i \ - $(WRAPPER_ROOT)/ace/SOCK_Connector.i \ - $(WRAPPER_ROOT)/ace/LSOCK_Stream.h \ - $(WRAPPER_ROOT)/ace/LSOCK.h \ - $(WRAPPER_ROOT)/ace/LSOCK.i \ - $(WRAPPER_ROOT)/ace/LSOCK_Stream.i \ - $(WRAPPER_ROOT)/ace/UNIX_Addr.h \ - $(WRAPPER_ROOT)/ace/LSOCK_Connector.i -.obj/FD-unserver.o .shobj/FD-unserver.so: FD-unserver.cpp \ - $(WRAPPER_ROOT)/ace/LSOCK_Acceptor.h \ - $(WRAPPER_ROOT)/ace/SOCK_Acceptor.h \ - $(WRAPPER_ROOT)/ace/SOCK_Stream.h \ - $(WRAPPER_ROOT)/ace/SOCK_IO.h \ - $(WRAPPER_ROOT)/ace/SOCK.h \ - $(WRAPPER_ROOT)/ace/ACE.h \ - $(WRAPPER_ROOT)/ace/OS.h \ - $(WRAPPER_ROOT)/ace/Time_Value.h \ - $(WRAPPER_ROOT)/ace/config.h \ - $(WRAPPER_ROOT)/ace/stdcpp.h \ - $(WRAPPER_ROOT)/ace/Trace.h \ - $(WRAPPER_ROOT)/ace/Log_Msg.h \ - $(WRAPPER_ROOT)/ace/Log_Record.h \ - $(WRAPPER_ROOT)/ace/Log_Priority.h \ - $(WRAPPER_ROOT)/ace/Log_Record.i \ - $(WRAPPER_ROOT)/ace/ACE.i \ - $(WRAPPER_ROOT)/ace/Addr.h \ - $(WRAPPER_ROOT)/ace/IPC_SAP.h \ - $(WRAPPER_ROOT)/ace/IPC_SAP.i \ - $(WRAPPER_ROOT)/ace/SOCK.i \ - $(WRAPPER_ROOT)/ace/SOCK_IO.i \ - $(WRAPPER_ROOT)/ace/INET_Addr.h \ - $(WRAPPER_ROOT)/ace/SOCK_Stream.i \ - $(WRAPPER_ROOT)/ace/UNIX_Addr.h \ - $(WRAPPER_ROOT)/ace/LSOCK_Stream.h \ - $(WRAPPER_ROOT)/ace/LSOCK.h \ - $(WRAPPER_ROOT)/ace/LSOCK.i \ - $(WRAPPER_ROOT)/ace/LSOCK_Stream.i -.obj/C-inclient.o .shobj/C-inclient.so: C-inclient.cpp \ - $(WRAPPER_ROOT)/ace/OS.h \ - $(WRAPPER_ROOT)/ace/Time_Value.h \ - $(WRAPPER_ROOT)/ace/config.h \ - $(WRAPPER_ROOT)/ace/stdcpp.h \ - $(WRAPPER_ROOT)/ace/Trace.h \ - $(WRAPPER_ROOT)/ace/Log_Msg.h \ - $(WRAPPER_ROOT)/ace/Log_Record.h \ - $(WRAPPER_ROOT)/ace/Log_Priority.h \ - $(WRAPPER_ROOT)/ace/ACE.h \ - $(WRAPPER_ROOT)/ace/ACE.i \ - $(WRAPPER_ROOT)/ace/Log_Record.i -.obj/C-inserver.o .shobj/C-inserver.so: C-inserver.cpp \ - $(WRAPPER_ROOT)/ace/OS.h \ - $(WRAPPER_ROOT)/ace/Time_Value.h \ - $(WRAPPER_ROOT)/ace/config.h \ - $(WRAPPER_ROOT)/ace/stdcpp.h \ - $(WRAPPER_ROOT)/ace/Trace.h \ - $(WRAPPER_ROOT)/ace/Log_Msg.h \ - $(WRAPPER_ROOT)/ace/Log_Record.h \ - $(WRAPPER_ROOT)/ace/Log_Priority.h \ - $(WRAPPER_ROOT)/ace/ACE.h \ - $(WRAPPER_ROOT)/ace/ACE.i \ - $(WRAPPER_ROOT)/ace/Log_Record.i - -# IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/examples/IPC_SAP/SOCK_SAP/README b/examples/IPC_SAP/SOCK_SAP/README deleted file mode 100644 index 9f154faf6de..00000000000 --- a/examples/IPC_SAP/SOCK_SAP/README +++ /dev/null @@ -1,38 +0,0 @@ -This directory contains groups of client and server test programs that -exercise the various C++ wrappers for sockets. In general, the test -programs do more or less the same thing -- the client establishes a -connection with the server and then transfers data to the server, -which keeps printing the data until EOF is reached (e.g., user types -^D). - -Unless noted differently, the server is implemented as an "iterative -server," i.e., it only deals with one client at a time. The following -describes each set of tests in more detail: - - . C-inclient.cpp/C-inserver.cpp -- This is basically a C code - implementation that opens a connection to the server and - sends all the data from the stdin using Internet domain - sockets (i.e., TCP). - - . CPP-inclient.cpp/CPP-server.cpp -- This test is basically - a C++ wrapper version of the preceeding "C" test using - Internet domain sockets (i.e., TCP). - - . CPP-unclient.cpp/CPP-unserver.cpp -- This test is basically - a C++ wrapper version of the preceeding "C++" test using - UNIX domain sockets. - - . FD-unclient.cpp/FD-inclient.cpp -- This test illustrates - how to pass file descriptors between two processes on the - same machine using the ACE C++ wrappers for UNIX domain - sockets. - - . CPP-inserver-poll.cpp -- This test illustrates how to - write single-threaded concurrent servers using UNIX SVR4 - poll(). You can run this test using the CPP-inclient.cpp - program as the client. - -For examples of the ACE SOCK_{Dgram,CODgram} and -SOCK_Dgram_{Mcast,Bcast} wrappers, please take a look in the -./examples/Reactor/{Dgram,Multicast,Ntalker} directories. - diff --git a/examples/IPC_SAP/SOCK_SAP/local_data b/examples/IPC_SAP/SOCK_SAP/local_data deleted file mode 100644 index c0119859a28..00000000000 --- a/examples/IPC_SAP/SOCK_SAP/local_data +++ /dev/null @@ -1 +0,0 @@ -I am Iron man! diff --git a/examples/IPC_SAP/SPIPE_SAP/Makefile b/examples/IPC_SAP/SPIPE_SAP/Makefile deleted file mode 100644 index b95818890e2..00000000000 --- a/examples/IPC_SAP/SPIPE_SAP/Makefile +++ /dev/null @@ -1,226 +0,0 @@ -#---------------------------------------------------------------------------- -# @(#)Makefile 1.1 10/18/96 -# -# Makefile for the simple STREAM pipe client/server test file -#---------------------------------------------------------------------------- - -#---------------------------------------------------------------------------- -# Local macros -#---------------------------------------------------------------------------- - -BIN = client \ - server \ - consumer_msg \ - consumer_read \ - producer_msg \ - producer_read \ - NPClient \ - NPServer - -LSRC = $(addsuffix .cpp,$(BIN)) - -VLDLIBS = $(LDLIBS:%=%$(VAR)) - -BUILD = $(VBIN) - -#---------------------------------------------------------------------------- -# Include macros and targets -#---------------------------------------------------------------------------- - -include $(WRAPPER_ROOT)/include/makeinclude/wrapper_macros.GNU -include $(WRAPPER_ROOT)/include/makeinclude/macros.GNU -include $(WRAPPER_ROOT)/include/makeinclude/rules.common.GNU -include $(WRAPPER_ROOT)/include/makeinclude/rules.nonested.GNU -include $(WRAPPER_ROOT)/include/makeinclude/rules.bin.GNU -include $(WRAPPER_ROOT)/include/makeinclude/rules.local.GNU - -#---------------------------------------------------------------------------- -# Local targets -#---------------------------------------------------------------------------- - -#---------------------------------------------------------------------------- -# Dependencies -#---------------------------------------------------------------------------- -# DO NOT DELETE THIS LINE -- g++dep uses it. -# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. - -.obj/client.o .shobj/client.so: client.cpp \ - $(WRAPPER_ROOT)/ace/SPIPE_Addr.h \ - $(WRAPPER_ROOT)/ace/Addr.h \ - $(WRAPPER_ROOT)/ace/ACE.h \ - $(WRAPPER_ROOT)/ace/OS.h \ - $(WRAPPER_ROOT)/ace/Time_Value.h \ - $(WRAPPER_ROOT)/ace/config.h \ - $(WRAPPER_ROOT)/ace/stdcpp.h \ - $(WRAPPER_ROOT)/ace/Trace.h \ - $(WRAPPER_ROOT)/ace/Log_Msg.h \ - $(WRAPPER_ROOT)/ace/Log_Record.h \ - $(WRAPPER_ROOT)/ace/Log_Priority.h \ - $(WRAPPER_ROOT)/ace/Log_Record.i \ - $(WRAPPER_ROOT)/ace/ACE.i \ - $(WRAPPER_ROOT)/ace/SPIPE_Connector.h \ - $(WRAPPER_ROOT)/ace/SPIPE_Stream.h \ - $(WRAPPER_ROOT)/ace/SPIPE.h \ - $(WRAPPER_ROOT)/ace/IPC_SAP.h \ - $(WRAPPER_ROOT)/ace/IPC_SAP.i \ - $(WRAPPER_ROOT)/ace/SPIPE.i \ - $(WRAPPER_ROOT)/ace/SPIPE_Stream.i \ - $(WRAPPER_ROOT)/ace/SPIPE_Connector.i \ - shared.h -.obj/server.o .shobj/server.so: server.cpp \ - $(WRAPPER_ROOT)/ace/SPIPE_Addr.h \ - $(WRAPPER_ROOT)/ace/Addr.h \ - $(WRAPPER_ROOT)/ace/ACE.h \ - $(WRAPPER_ROOT)/ace/OS.h \ - $(WRAPPER_ROOT)/ace/Time_Value.h \ - $(WRAPPER_ROOT)/ace/config.h \ - $(WRAPPER_ROOT)/ace/stdcpp.h \ - $(WRAPPER_ROOT)/ace/Trace.h \ - $(WRAPPER_ROOT)/ace/Log_Msg.h \ - $(WRAPPER_ROOT)/ace/Log_Record.h \ - $(WRAPPER_ROOT)/ace/Log_Priority.h \ - $(WRAPPER_ROOT)/ace/Log_Record.i \ - $(WRAPPER_ROOT)/ace/ACE.i \ - $(WRAPPER_ROOT)/ace/SPIPE_Acceptor.h \ - $(WRAPPER_ROOT)/ace/SPIPE_Stream.h \ - $(WRAPPER_ROOT)/ace/SPIPE.h \ - $(WRAPPER_ROOT)/ace/IPC_SAP.h \ - $(WRAPPER_ROOT)/ace/IPC_SAP.i \ - $(WRAPPER_ROOT)/ace/SPIPE.i \ - $(WRAPPER_ROOT)/ace/SPIPE_Stream.i \ - shared.h -.obj/consumer_msg.o .shobj/consumer_msg.so: consumer_msg.cpp \ - $(WRAPPER_ROOT)/ace/SPIPE_Addr.h \ - $(WRAPPER_ROOT)/ace/Addr.h \ - $(WRAPPER_ROOT)/ace/ACE.h \ - $(WRAPPER_ROOT)/ace/OS.h \ - $(WRAPPER_ROOT)/ace/Time_Value.h \ - $(WRAPPER_ROOT)/ace/config.h \ - $(WRAPPER_ROOT)/ace/stdcpp.h \ - $(WRAPPER_ROOT)/ace/Trace.h \ - $(WRAPPER_ROOT)/ace/Log_Msg.h \ - $(WRAPPER_ROOT)/ace/Log_Record.h \ - $(WRAPPER_ROOT)/ace/Log_Priority.h \ - $(WRAPPER_ROOT)/ace/Log_Record.i \ - $(WRAPPER_ROOT)/ace/ACE.i \ - $(WRAPPER_ROOT)/ace/SPIPE_Acceptor.h \ - $(WRAPPER_ROOT)/ace/SPIPE_Stream.h \ - $(WRAPPER_ROOT)/ace/SPIPE.h \ - $(WRAPPER_ROOT)/ace/IPC_SAP.h \ - $(WRAPPER_ROOT)/ace/IPC_SAP.i \ - $(WRAPPER_ROOT)/ace/SPIPE.i \ - $(WRAPPER_ROOT)/ace/SPIPE_Stream.i \ - shared.h -.obj/consumer_read.o .shobj/consumer_read.so: consumer_read.cpp \ - $(WRAPPER_ROOT)/ace/SPIPE_Addr.h \ - $(WRAPPER_ROOT)/ace/Addr.h \ - $(WRAPPER_ROOT)/ace/ACE.h \ - $(WRAPPER_ROOT)/ace/OS.h \ - $(WRAPPER_ROOT)/ace/Time_Value.h \ - $(WRAPPER_ROOT)/ace/config.h \ - $(WRAPPER_ROOT)/ace/stdcpp.h \ - $(WRAPPER_ROOT)/ace/Trace.h \ - $(WRAPPER_ROOT)/ace/Log_Msg.h \ - $(WRAPPER_ROOT)/ace/Log_Record.h \ - $(WRAPPER_ROOT)/ace/Log_Priority.h \ - $(WRAPPER_ROOT)/ace/Log_Record.i \ - $(WRAPPER_ROOT)/ace/ACE.i \ - $(WRAPPER_ROOT)/ace/SPIPE_Acceptor.h \ - $(WRAPPER_ROOT)/ace/SPIPE_Stream.h \ - $(WRAPPER_ROOT)/ace/SPIPE.h \ - $(WRAPPER_ROOT)/ace/IPC_SAP.h \ - $(WRAPPER_ROOT)/ace/IPC_SAP.i \ - $(WRAPPER_ROOT)/ace/SPIPE.i \ - $(WRAPPER_ROOT)/ace/SPIPE_Stream.i \ - shared.h -.obj/producer_msg.o .shobj/producer_msg.so: producer_msg.cpp \ - $(WRAPPER_ROOT)/ace/SPIPE_Addr.h \ - $(WRAPPER_ROOT)/ace/Addr.h \ - $(WRAPPER_ROOT)/ace/ACE.h \ - $(WRAPPER_ROOT)/ace/OS.h \ - $(WRAPPER_ROOT)/ace/Time_Value.h \ - $(WRAPPER_ROOT)/ace/config.h \ - $(WRAPPER_ROOT)/ace/stdcpp.h \ - $(WRAPPER_ROOT)/ace/Trace.h \ - $(WRAPPER_ROOT)/ace/Log_Msg.h \ - $(WRAPPER_ROOT)/ace/Log_Record.h \ - $(WRAPPER_ROOT)/ace/Log_Priority.h \ - $(WRAPPER_ROOT)/ace/Log_Record.i \ - $(WRAPPER_ROOT)/ace/ACE.i \ - $(WRAPPER_ROOT)/ace/SPIPE_Connector.h \ - $(WRAPPER_ROOT)/ace/SPIPE_Stream.h \ - $(WRAPPER_ROOT)/ace/SPIPE.h \ - $(WRAPPER_ROOT)/ace/IPC_SAP.h \ - $(WRAPPER_ROOT)/ace/IPC_SAP.i \ - $(WRAPPER_ROOT)/ace/SPIPE.i \ - $(WRAPPER_ROOT)/ace/SPIPE_Stream.i \ - $(WRAPPER_ROOT)/ace/SPIPE_Connector.i \ - shared.h -.obj/producer_read.o .shobj/producer_read.so: producer_read.cpp \ - $(WRAPPER_ROOT)/ace/SPIPE_Addr.h \ - $(WRAPPER_ROOT)/ace/Addr.h \ - $(WRAPPER_ROOT)/ace/ACE.h \ - $(WRAPPER_ROOT)/ace/OS.h \ - $(WRAPPER_ROOT)/ace/Time_Value.h \ - $(WRAPPER_ROOT)/ace/config.h \ - $(WRAPPER_ROOT)/ace/stdcpp.h \ - $(WRAPPER_ROOT)/ace/Trace.h \ - $(WRAPPER_ROOT)/ace/Log_Msg.h \ - $(WRAPPER_ROOT)/ace/Log_Record.h \ - $(WRAPPER_ROOT)/ace/Log_Priority.h \ - $(WRAPPER_ROOT)/ace/Log_Record.i \ - $(WRAPPER_ROOT)/ace/ACE.i \ - $(WRAPPER_ROOT)/ace/SPIPE_Connector.h \ - $(WRAPPER_ROOT)/ace/SPIPE_Stream.h \ - $(WRAPPER_ROOT)/ace/SPIPE.h \ - $(WRAPPER_ROOT)/ace/IPC_SAP.h \ - $(WRAPPER_ROOT)/ace/IPC_SAP.i \ - $(WRAPPER_ROOT)/ace/SPIPE.i \ - $(WRAPPER_ROOT)/ace/SPIPE_Stream.i \ - $(WRAPPER_ROOT)/ace/SPIPE_Connector.i \ - shared.h -.obj/NPClient.o .shobj/NPClient.so: NPClient.cpp \ - $(WRAPPER_ROOT)/ace/SPIPE_Addr.h \ - $(WRAPPER_ROOT)/ace/Addr.h \ - $(WRAPPER_ROOT)/ace/ACE.h \ - $(WRAPPER_ROOT)/ace/OS.h \ - $(WRAPPER_ROOT)/ace/Time_Value.h \ - $(WRAPPER_ROOT)/ace/config.h \ - $(WRAPPER_ROOT)/ace/stdcpp.h \ - $(WRAPPER_ROOT)/ace/Trace.h \ - $(WRAPPER_ROOT)/ace/Log_Msg.h \ - $(WRAPPER_ROOT)/ace/Log_Record.h \ - $(WRAPPER_ROOT)/ace/Log_Priority.h \ - $(WRAPPER_ROOT)/ace/Log_Record.i \ - $(WRAPPER_ROOT)/ace/ACE.i \ - $(WRAPPER_ROOT)/ace/SPIPE_Connector.h \ - $(WRAPPER_ROOT)/ace/SPIPE_Stream.h \ - $(WRAPPER_ROOT)/ace/SPIPE.h \ - $(WRAPPER_ROOT)/ace/IPC_SAP.h \ - $(WRAPPER_ROOT)/ace/IPC_SAP.i \ - $(WRAPPER_ROOT)/ace/SPIPE.i \ - $(WRAPPER_ROOT)/ace/SPIPE_Stream.i \ - $(WRAPPER_ROOT)/ace/SPIPE_Connector.i -.obj/NPServer.o .shobj/NPServer.so: NPServer.cpp \ - $(WRAPPER_ROOT)/ace/SPIPE_Addr.h \ - $(WRAPPER_ROOT)/ace/Addr.h \ - $(WRAPPER_ROOT)/ace/ACE.h \ - $(WRAPPER_ROOT)/ace/OS.h \ - $(WRAPPER_ROOT)/ace/Time_Value.h \ - $(WRAPPER_ROOT)/ace/config.h \ - $(WRAPPER_ROOT)/ace/stdcpp.h \ - $(WRAPPER_ROOT)/ace/Trace.h \ - $(WRAPPER_ROOT)/ace/Log_Msg.h \ - $(WRAPPER_ROOT)/ace/Log_Record.h \ - $(WRAPPER_ROOT)/ace/Log_Priority.h \ - $(WRAPPER_ROOT)/ace/Log_Record.i \ - $(WRAPPER_ROOT)/ace/ACE.i \ - $(WRAPPER_ROOT)/ace/SPIPE_Acceptor.h \ - $(WRAPPER_ROOT)/ace/SPIPE_Stream.h \ - $(WRAPPER_ROOT)/ace/SPIPE.h \ - $(WRAPPER_ROOT)/ace/IPC_SAP.h \ - $(WRAPPER_ROOT)/ace/IPC_SAP.i \ - $(WRAPPER_ROOT)/ace/SPIPE.i \ - $(WRAPPER_ROOT)/ace/SPIPE_Stream.i - -# IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/examples/IPC_SAP/SPIPE_SAP/NPClient.cpp b/examples/IPC_SAP/SPIPE_SAP/NPClient.cpp deleted file mode 100644 index a4594064882..00000000000 --- a/examples/IPC_SAP/SPIPE_SAP/NPClient.cpp +++ /dev/null @@ -1,46 +0,0 @@ - -// $Id$ - -#include "ace/SPIPE_Addr.h" -#include "ace/SPIPE_Connector.h" - -#if defined (ACE_WIN32) -#define MAKE_PIPE_NAME(X) \\\\.\\pipe\\#X -#else -#define MAKE_PIPE_NAME(X) X -#endif - -const int DEFAULT_SIZE = 8; -const int DEFAULT_COUNT = 10000; - -int -main (int argc, char *argv[]) -{ - int size = argc > 1 ? atoi (argv[1]) : DEFAULT_SIZE; - int iterations = argc > 2 ? atoi (argv[2]) : DEFAULT_COUNT; - char *buf = new char[size]; - - //char *pipe_name = ACE_DEFAULT_RENDEZVOUS; - char *pipe_name = "acepipe"; - char *rendezvous; - rendezvous = MAKE_PIPE_NAME (pipe_name); - - ACE_SPIPE_Stream cli_stream; - ACE_SPIPE_Connector con; - int i; - - if (con.connect (cli_stream, ACE_SPIPE_Addr (rendezvous)) == -1) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", rendezvous), -1); - - ACE_OS::strcpy (buf, "hello"); - size = ACE_OS::strlen (buf) + 1; - - for (i = 0; i < iterations; i++) - if (cli_stream.send (buf, size) != size) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "putmsg"), -1); - - if (cli_stream.close () == -1) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "close"), -1); - - return 0; -} diff --git a/examples/IPC_SAP/SPIPE_SAP/NPServer.cpp b/examples/IPC_SAP/SPIPE_SAP/NPServer.cpp deleted file mode 100644 index 5a122fefc14..00000000000 --- a/examples/IPC_SAP/SPIPE_SAP/NPServer.cpp +++ /dev/null @@ -1,54 +0,0 @@ - -// $Id$ - -#include "ace/SPIPE_Addr.h" -#include "ace/Time_Value.h" -#include "ace/SPIPE_Acceptor.h" - -#if defined (ACE_WIN32) -#define MAKE_PIPE_NAME(X) \\\\.\\pipe\\#X -#else -#define MAKE_PIPE_NAME(X) X -#endif - -int -main (int argc, char *argv[]) -{ - ACE_SPIPE_Acceptor acceptor; - ACE_SPIPE_Stream new_stream; - char buf[BUFSIZ]; - int n; - // char *pipe_name = ACE_DEFAULT_RENDEZVOUS; - char *pipe_name = "acepipe"; - - char *rendezvous; - rendezvous = MAKE_PIPE_NAME (pipe_name); - - /* Initialize named pipe listener */ - - if (acceptor.open (ACE_SPIPE_Addr (rendezvous)) == -1) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "open"), 1); - - for (;;) - { - ACE_DEBUG ((LM_DEBUG, "waiting for connection\n")); - - /* Accept a client connection */ - if (acceptor.accept (new_stream, 0) == -1) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "accept"), 1); - - ACE_DEBUG ((LM_DEBUG, "Accepted connection\n")); - - while ((n = new_stream.recv (buf, sizeof buf)) > 0) - { - cerr << buf << endl; - ACE_OS::write (ACE_STDOUT, buf, n); - } - if (n == -1) - { - ACE_DEBUG ((LM_DEBUG, "End of connection. Closing handle\n")); - new_stream.close (); - } - } - return 0; -} diff --git a/examples/IPC_SAP/SPIPE_SAP/client.cpp b/examples/IPC_SAP/SPIPE_SAP/client.cpp deleted file mode 100644 index 20d3caa4765..00000000000 --- a/examples/IPC_SAP/SPIPE_SAP/client.cpp +++ /dev/null @@ -1,42 +0,0 @@ - -// $Id$ - -#include "ace/SPIPE_Addr.h" -#include "ace/SPIPE_Connector.h" -#include "shared.h" - -#if defined (ACE_HAS_STREAM_PIPES) - -int -main (int argc, char *argv[]) -{ - if (argc < 2) - ACE_ERROR_RETURN ((LM_ERROR, "usage: %s string [rendezvous]\n", argv[0]), 1); - - if (argc > 2) - rendezvous = argv[2]; - - ACE_SPIPE_Stream cli_stream; - ACE_SPIPE_Connector con; - - if (con.connect (cli_stream, ACE_SPIPE_Addr (rendezvous)) == -1) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", rendezvous), 1); - - size_t len = ACE_OS::strlen (argv[1]) + 1; - - if (cli_stream.send (argv[1], len) != len) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "send"), 1); - - if (cli_stream.close () == -1) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "close"), 1); - - return 0; -} -#else -#include <stdio.h> -int main (void) -{ - ACE_OS::fprintf (stderr, "This feature is not supported\n"); - return 0; -} -#endif /* ACE_HAS_STREAM_PIPES */ diff --git a/examples/IPC_SAP/SPIPE_SAP/consumer_msg.cpp b/examples/IPC_SAP/SPIPE_SAP/consumer_msg.cpp deleted file mode 100644 index 85d6339a0f6..00000000000 --- a/examples/IPC_SAP/SPIPE_SAP/consumer_msg.cpp +++ /dev/null @@ -1,53 +0,0 @@ - -// $Id$ - -#include "ace/SPIPE_Addr.h" -#include "ace/SPIPE_Acceptor.h" -#include "ace/Time_Value.h" -#include "shared.h" - -#if defined (ACE_HAS_STREAM_PIPES) - -int -main (int argc, char *argv[]) -{ - ACE_SPIPE_Acceptor peer_acceptor; - ACE_SPIPE_Stream new_stream; - char buf[BUFSIZ]; - ACE_Str_Buf buffer (buf, 0, sizeof buf); - int flags = 0; - - if (argc > 1) - rendezvous = argv[1]; - - ACE_OS::unlink (rendezvous); - ACE_OS::fdetach (rendezvous); - - ACE_SPIPE_Addr addr (rendezvous); - ACE_Time_Value timeout (ACE_DEFAULT_TIMEOUT); - - if (peer_acceptor.open (addr) == -1) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "open"), 1); - - ACE_DEBUG ((LM_DEBUG, "waiting for connection\n")); - - if (peer_acceptor.accept (new_stream, 0, &timeout) == -1) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "accept"), 1); - - ACE_DEBUG ((LM_DEBUG, "accepted\n")); - - while (new_stream.recv ((ACE_Str_Buf *) 0, &buffer, &flags) >= 0) - if (buffer.len == 0) - break; - else - ACE_OS::write (ACE_STDOUT, buffer.buf, buffer.len); - return 0; -} -#else -#include <stdio.h> -int main (void) -{ - ACE_OS::fprintf (stderr, "This feature is not supported\n"); - return 0; -} -#endif /* ACE_HAS_STREAM_PIPES */ diff --git a/examples/IPC_SAP/SPIPE_SAP/consumer_read.cpp b/examples/IPC_SAP/SPIPE_SAP/consumer_read.cpp deleted file mode 100644 index d6ca116b5db..00000000000 --- a/examples/IPC_SAP/SPIPE_SAP/consumer_read.cpp +++ /dev/null @@ -1,50 +0,0 @@ - -// $Id$ - -#include "ace/SPIPE_Addr.h" -#include "ace/SPIPE_Acceptor.h" -#include "ace/Time_Value.h" -#include "shared.h" - -#if defined (ACE_HAS_STREAM_PIPES) - -int -main (int argc, char *argv[]) -{ - ACE_SPIPE_Acceptor peer_acceptor; - ACE_SPIPE_Stream new_stream; - char buf[BUFSIZ]; - int n; - - // Wait up to ACE_DEFAULT_TIMEOUT seconds to accept connection. - ACE_Time_Value timeout (ACE_DEFAULT_TIMEOUT); - - if (argc > 1) - rendezvous = argv[1]; - - ACE_OS::unlink (rendezvous); - ACE_OS::fdetach (rendezvous); - - if (peer_acceptor.open (ACE_SPIPE_Addr (rendezvous)) == -1) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "open"), 1); - - ACE_DEBUG ((LM_DEBUG, "waiting for connection\n")); - - if (peer_acceptor.accept (new_stream, 0, &timeout) == -1) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "accept"), 1); - - ACE_DEBUG ((LM_DEBUG, "accepted\n")); - - while ((n = new_stream.recv (buf, sizeof buf)) > 0) - ACE_OS::write (ACE_STDOUT, buf, n); - - return 0; -} -#else -#include <stdio.h> -int main (void) -{ - ACE_OS::fprintf (stderr, "This feature is not supported\n"); - return 0; -} -#endif /* ACE_HAS_STREAM_PIPES */ diff --git a/examples/IPC_SAP/SPIPE_SAP/producer_msg.cpp b/examples/IPC_SAP/SPIPE_SAP/producer_msg.cpp deleted file mode 100644 index e2f2940e75f..00000000000 --- a/examples/IPC_SAP/SPIPE_SAP/producer_msg.cpp +++ /dev/null @@ -1,52 +0,0 @@ - -// $Id$ - -#include "ace/SPIPE_Addr.h" -#include "ace/SPIPE_Connector.h" -#include "shared.h" - -#if defined (ACE_HAS_STREAM_PIPES) - -const int DEFAULT_SIZE = 4 * 1024; -const int DEFAULT_COUNT = 100; - -int -main (int argc, char *argv[]) -{ - int size = argc > 1 ? atoi (argv[1]) : DEFAULT_SIZE; - int iterations = argc > 2 ? atoi (argv[2]) : DEFAULT_COUNT; - char *buf = new char[size]; - - if (argc > 3) - rendezvous = argv[3]; - - ACE_SPIPE_Stream cli_stream; - ACE_SPIPE_Connector con; - int i; - - if (con.connect (cli_stream, ACE_SPIPE_Addr (rendezvous)) == -1) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", rendezvous), 1); - - for (i = 0; i < size; i++) - buf[i] = 'a'; - - ACE_Str_Buf buffer (buf, size); - - for (i = 0; i < iterations; i++) - if (cli_stream.send ((ACE_Str_Buf *) 0, &buffer) == -1) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "send"), 1); - - if (cli_stream.close () == -1) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "close"), 1); - - delete buf; - return 0; -} -#else -#include <stdio.h> -int main (void) -{ - ACE_OS::fprintf (stderr, "This feature is not supported\n"); - return 0; -} -#endif /* ACE_HAS_STREAM_PIPES */ diff --git a/examples/IPC_SAP/SPIPE_SAP/producer_read.cpp b/examples/IPC_SAP/SPIPE_SAP/producer_read.cpp deleted file mode 100644 index 033dacb04ab..00000000000 --- a/examples/IPC_SAP/SPIPE_SAP/producer_read.cpp +++ /dev/null @@ -1,49 +0,0 @@ - -// $Id$ - -#include "ace/SPIPE_Addr.h" -#include "ace/SPIPE_Connector.h" -#include "shared.h" - -#if defined (ACE_HAS_STREAM_PIPES) - -const int DEFAULT_SIZE = 8 * 1024; -const int DEFAULT_COUNT = 100; - -int -main (int argc, char *argv[]) -{ - int size = argc > 1 ? atoi (argv[1]) : DEFAULT_SIZE; - int iterations = argc > 2 ? atoi (argv[2]) : DEFAULT_COUNT; - char *buf = new char[size]; - - if (argc > 3) - rendezvous = argv[3]; - - ACE_SPIPE_Stream cli_stream; - ACE_SPIPE_Connector con; - int i; - - if (con.connect (cli_stream, ACE_SPIPE_Addr (rendezvous)) == -1) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", rendezvous), -1); - - for (i = 0; i < size; i++) - buf[i] = 'a'; - - for (i = 0; i < iterations; i++) - if (cli_stream.send (buf, size) != size) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "putmsg"), -1); - - if (cli_stream.close () == -1) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "close"), -1); - - return 0; -} -#else -#include <stdio.h> -int main (void) -{ - ACE_ERROR_RETURN ((LM_ERROR, "this feature is not supported"), -1); - return 0; -} -#endif /* ACE_HAS_STREAM_PIPES */ diff --git a/examples/IPC_SAP/SPIPE_SAP/server.cpp b/examples/IPC_SAP/SPIPE_SAP/server.cpp deleted file mode 100644 index 2d46a882f8a..00000000000 --- a/examples/IPC_SAP/SPIPE_SAP/server.cpp +++ /dev/null @@ -1,116 +0,0 @@ -#include "ace/SPIPE_Addr.h" -// $Id$ - -#include "ace/SPIPE_Acceptor.h" -#include "shared.h" - -#if defined (ACE_HAS_STREAM_PIPES) - -/* Maximum per-process open I/O descriptors */ -const int MAX_FDS = 200; -const int PERMS = 0666; - -int -main (int argc, char *argv[]) -{ - ACE_SPIPE_Acceptor peer_acceptor; - ACE_SPIPE_Stream new_stream; - int s_handle; - struct pollfd poll_array[MAX_FDS]; - - if (argc > 1) - rendezvous = argv[1]; - - ACE_OS::fdetach (rendezvous); - - ACE_SPIPE_Addr addr (rendezvous); - - if ((s_handle = peer_acceptor.open (addr)) == -1) - ACE_OS::perror ("peer_acceptor.open"), ACE_OS::exit (1); - - for (int fd = 0; fd < MAX_FDS; fd++) - { - poll_array[fd].fd = -1; - poll_array[fd].events = POLLIN; - } - - poll_array[0].fd = s_handle; - - for (int width = 1;;) - { - // Block waiting for client I/O events (handle interrupts). - while (ACE_OS::poll (poll_array, width) == -1 && errno == EINTR) - continue; - - /* Handle pending logging messages first (s_handle + 1 - is guaranteed to be lowest client descriptor) */ - - for (int fd = s_handle + 1; fd < width; fd++) - if ((poll_array[fd].revents & POLLIN) - || (poll_array[fd].revents & POLLHUP)) - { - char buf[BUFSIZ]; - int n; - - /* recv will not block in this case! */ - if ((n = ACE_OS::read (fd, buf, sizeof buf)) == -1) - ACE_OS::perror ("read failed"); - else if (n == 0) - { - /* Handle client connection shutdown */ - if (ACE_OS::close (poll_array[fd].fd) == -1) - ACE_OS::perror ("close"); - poll_array[fd].fd = -1; - - if (fd + 1 == width) - { - while (poll_array[fd].fd == -1) - fd--; - width = fd + 1; - } - } - else - { - ::printf ("%*s\n", n, buf); - fflush (stdout); - } - } - - if (poll_array[0].revents & POLLIN) - { - int arg; - int n_handle; - ACE_SPIPE_Addr client; - - if (peer_acceptor.accept (new_stream) == -1) - ACE_OS::perror ("local_accept"); - - n_handle = new_stream.get_handle (); - - if (new_stream.get_remote_addr (client) == -1) - ACE_OS::perror ("get_remote_addr"); - - ACE_OS::printf ("n_handle = %d, uid = %d, gid = %d\n", - n_handle, client.user_id (), client.group_id ()); - - arg = RMSGN | RPROTDAT; - - if (ACE_OS::ioctl (n_handle, I_SRDOPT, (void *) arg) == -1) - ACE_OS::perror ("I_RRDOPT"); - - poll_array[n_handle].fd = n_handle; - if (n_handle >= width) - width = n_handle + 1; - } - } - - return 0; -} -#else -#include <stdio.h> -int main (void) -{ - ACE_OS::fprintf (stderr, "This feature is not supported\n"); - return 0; -} -#endif /* ACE_HAS_STREAM_PIPES */ diff --git a/examples/IPC_SAP/SPIPE_SAP/shared.h b/examples/IPC_SAP/SPIPE_SAP/shared.h deleted file mode 100644 index 3f7d7647023..00000000000 --- a/examples/IPC_SAP/SPIPE_SAP/shared.h +++ /dev/null @@ -1,6 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -#include "ace/OS.h" - -static const char *rendezvous = ACE_DEFAULT_RENDEZVOUS; diff --git a/examples/IPC_SAP/TLI_SAP/CPP-client.cpp b/examples/IPC_SAP/TLI_SAP/CPP-client.cpp deleted file mode 100644 index cf491dff8fa..00000000000 --- a/examples/IPC_SAP/TLI_SAP/CPP-client.cpp +++ /dev/null @@ -1,68 +0,0 @@ - -// $Id$ - -#include "ace/TLI_Connector.h" -#include "ace/INET_Addr.h" -#include "ace/Time_Value.h" - -#if defined (ACE_HAS_TLI) - -/* ACE_TLI Client */ - -int main (int argc, char *argv[]) -{ - char *host = argc > 1 ? argv[1] : ACE_DEFAULT_SERVER_HOST; - u_short r_port = argc > 2 ? ACE_OS::atoi (argv[2]) : ACE_DEFAULT_SERVER_PORT; - int timeout = argc > 3 ? ACE_OS::atoi (argv[3]) : ACE_DEFAULT_TIMEOUT; - u_short l_port = argc > 4 ? ACE_OS::atoi (argv[4]) : ACE_DEFAULT_LOCAL_PORT; - char buf[BUFSIZ]; - - ACE_TLI_Stream cli_stream; - ACE_INET_Addr remote_addr (r_port, host); - ACE_INET_Addr local_addr (l_port); - - ACE_DEBUG ((LM_DEBUG, "starting non-blocking connect\n")); - - // Initiate timed, non-blocking connection with server. - ACE_TLI_Connector con; - - if (con.connect (cli_stream, remote_addr, - (ACE_Time_Value *) &ACE_Time_Value::zero, - local_addr, 1) == -1) - { - if (errno != EWOULDBLOCK) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "connection failed"), 1); - - ACE_DEBUG ((LM_DEBUG, "starting timed connect\n")); - - // Check if non-blocking connection is in progress, - // and wait up to timeout seconds for it to complete. - ACE_Time_Value tv (timeout); - - if (con.complete (cli_stream, &remote_addr, &tv) == -1) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "connection failed"), 1); - else - ACE_DEBUG ((LM_DEBUG, "connected to %s\n", - remote_addr.get_host_name ())); - } - - // Send data to server (correctly handles "incomplete writes"). - - for (int r_bytes; - (r_bytes = ACE_OS::read (ACE_STDIN, buf, sizeof buf)) > 0; ) - if (cli_stream.send_n (buf, r_bytes) == -1) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "send_n"), 1); - - /* Explicitly close the connection */ - if (cli_stream.close () == -1) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "close"), -1); - - return 0; -} -#else -int main (void) -{ - ACE_ERROR_RETURN ((LM_ERROR, - "your platform must support ACE_TLI\n"), 1); -} -#endif /* ACE_HAS_TLI */ diff --git a/examples/IPC_SAP/TLI_SAP/CPP-server.cpp b/examples/IPC_SAP/TLI_SAP/CPP-server.cpp deleted file mode 100644 index a47023b3609..00000000000 --- a/examples/IPC_SAP/TLI_SAP/CPP-server.cpp +++ /dev/null @@ -1,68 +0,0 @@ - -// $Id$ - -#include "ace/TLI_Acceptor.h" -#include "ace/INET_Addr.h" - -#if defined (ACE_HAS_TLI) -/* ACE_TLI Server */ - -int -main (int argc, char *argv[]) -{ - u_short port = argc > 1 ? ACE_OS::atoi (argv[1]) : ACE_DEFAULT_SERVER_PORT; - ACE_Time_Value timeout (argc > 2 ? ACE_OS::atoi (argv[2]) : ACE_DEFAULT_TIMEOUT); - - /* Create a server address. */ - ACE_INET_Addr addr (port); - - /* Create a server, reuse the addr. */ - ACE_TLI_Acceptor peer_acceptor; - - if (peer_acceptor.open (addr, 1) == -1) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "open"), -1); - - ACE_TLI_Stream new_stream; - - ACE_DEBUG ((LM_DEBUG, "starting server at port %d\n", - addr.get_port_number ())); - - /* Performs the iterative server activities */ - - for (;;) - { - char buf[BUFSIZ]; - - /* Create a new ACE_TLI_Stream endpoint (note automatic restart - if errno == EINTR) */ - if (peer_acceptor.accept (new_stream, - &addr, &timeout) == -1) - { - ACE_ERROR ((LM_ERROR, "%p\n", "accept")); - continue; - } - - ACE_DEBUG ((LM_DEBUG, "client %s connected from %d\n", - addr.get_host_name (), addr.get_port_number ())); - - // Read data from client (terminate on error). - - for (int r_bytes; - (r_bytes = new_stream.recv (buf, sizeof buf)) > 0; ) - if (ACE_OS::write (ACE_STDOUT, buf, r_bytes) != r_bytes) - ACE_ERROR ((LM_ERROR, "%p\n", "ACE::send_n")); - - // Close new endpoint (listening endpoint stays open). - if (new_stream.close () == -1) - ACE_ERROR ((LM_ERROR, "%p\n", "close")); - - } - /* NOTREACHED */ - return 0; -} -#else -int main (void) -{ - ACE_ERROR_RETURN ((LM_ERROR, "your platform must support ACE_TLI\n"), 1); -} -#endif /* ACE_HAS_TLI */ diff --git a/examples/IPC_SAP/TLI_SAP/Makefile b/examples/IPC_SAP/TLI_SAP/Makefile deleted file mode 100644 index a5743d7ef36..00000000000 --- a/examples/IPC_SAP/TLI_SAP/Makefile +++ /dev/null @@ -1,201 +0,0 @@ -#---------------------------------------------------------------------------- -# @(#)Makefile 1.1 10/18/96 -# -# Makefile for TLI_SAP test -#---------------------------------------------------------------------------- - -#---------------------------------------------------------------------------- -# Local macros -#---------------------------------------------------------------------------- - -BIN = ftp-client \ - ftp-server \ - db-client \ - db-server \ - CPP-client \ - CPP-server - -LSRC = $(addsuffix .cpp,$(BIN)) - -LDLIBS= - -VLDLIBS = $(LDLIBS:%=%$(VAR)) - -BUILD = $(VBIN) - -INSTALL = - -#---------------------------------------------------------------------------- -# Include macros and targets -#---------------------------------------------------------------------------- - -include $(WRAPPER_ROOT)/include/makeinclude/wrapper_macros.GNU -include $(WRAPPER_ROOT)/include/makeinclude/macros.GNU -include $(WRAPPER_ROOT)/include/makeinclude/rules.common.GNU -include $(WRAPPER_ROOT)/include/makeinclude/rules.nonested.GNU -include $(WRAPPER_ROOT)/include/makeinclude/rules.bin.GNU -include $(WRAPPER_ROOT)/include/makeinclude/rules.local.GNU - -#---------------------------------------------------------------------------- -# Local targets -#---------------------------------------------------------------------------- - -#---------------------------------------------------------------------------- -# Dependencies -#---------------------------------------------------------------------------- - -# DO NOT DELETE THIS LINE -- g++dep uses it. -# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. - -.obj/ftp-client.o .shobj/ftp-client.so: ftp-client.cpp \ - $(WRAPPER_ROOT)/ace/TLI_Connector.h \ - $(WRAPPER_ROOT)/ace/TLI_Stream.h \ - $(WRAPPER_ROOT)/ace/TLI.h \ - $(WRAPPER_ROOT)/ace/IPC_SAP.h \ - $(WRAPPER_ROOT)/ace/ACE.h \ - $(WRAPPER_ROOT)/ace/OS.h \ - $(WRAPPER_ROOT)/ace/Time_Value.h \ - $(WRAPPER_ROOT)/ace/config.h \ - $(WRAPPER_ROOT)/ace/stdcpp.h \ - $(WRAPPER_ROOT)/ace/Trace.h \ - $(WRAPPER_ROOT)/ace/Log_Msg.h \ - $(WRAPPER_ROOT)/ace/Log_Record.h \ - $(WRAPPER_ROOT)/ace/Log_Priority.h \ - $(WRAPPER_ROOT)/ace/Log_Record.i \ - $(WRAPPER_ROOT)/ace/ACE.i \ - $(WRAPPER_ROOT)/ace/IPC_SAP.i \ - $(WRAPPER_ROOT)/ace/Addr.h \ - $(WRAPPER_ROOT)/ace/TLI.i \ - $(WRAPPER_ROOT)/ace/INET_Addr.h \ - $(WRAPPER_ROOT)/ace/TLI_Stream.i \ - $(WRAPPER_ROOT)/ace/TLI_Connector.i -.obj/ftp-server.o .shobj/ftp-server.so: ftp-server.cpp \ - $(WRAPPER_ROOT)/ace/Thread_Manager.h \ - $(WRAPPER_ROOT)/ace/Thread.h \ - $(WRAPPER_ROOT)/ace/ACE.h \ - $(WRAPPER_ROOT)/ace/OS.h \ - $(WRAPPER_ROOT)/ace/Time_Value.h \ - $(WRAPPER_ROOT)/ace/config.h \ - $(WRAPPER_ROOT)/ace/stdcpp.h \ - $(WRAPPER_ROOT)/ace/Trace.h \ - $(WRAPPER_ROOT)/ace/Log_Msg.h \ - $(WRAPPER_ROOT)/ace/Log_Record.h \ - $(WRAPPER_ROOT)/ace/Log_Priority.h \ - $(WRAPPER_ROOT)/ace/Log_Record.i \ - $(WRAPPER_ROOT)/ace/ACE.i \ - $(WRAPPER_ROOT)/ace/Synch.h \ - $(WRAPPER_ROOT)/ace/SV_Semaphore_Complex.h \ - $(WRAPPER_ROOT)/ace/SV_Semaphore_Simple.h \ - $(WRAPPER_ROOT)/ace/SV_Semaphore_Simple.i \ - $(WRAPPER_ROOT)/ace/SV_Semaphore_Complex.i \ - $(WRAPPER_ROOT)/ace/Synch_T.h \ - $(WRAPPER_ROOT)/ace/Event_Handler.h \ - $(WRAPPER_ROOT)/ace/TLI_Acceptor.h \ - $(WRAPPER_ROOT)/ace/TLI.h \ - $(WRAPPER_ROOT)/ace/IPC_SAP.h \ - $(WRAPPER_ROOT)/ace/IPC_SAP.i \ - $(WRAPPER_ROOT)/ace/Addr.h \ - $(WRAPPER_ROOT)/ace/TLI.i \ - $(WRAPPER_ROOT)/ace/TLI_Stream.h \ - $(WRAPPER_ROOT)/ace/INET_Addr.h \ - $(WRAPPER_ROOT)/ace/TLI_Stream.i \ - $(WRAPPER_ROOT)/ace/TLI_Acceptor.i -.obj/db-client.o .shobj/db-client.so: db-client.cpp \ - $(WRAPPER_ROOT)/ace/TLI_Connector.h \ - $(WRAPPER_ROOT)/ace/TLI_Stream.h \ - $(WRAPPER_ROOT)/ace/TLI.h \ - $(WRAPPER_ROOT)/ace/IPC_SAP.h \ - $(WRAPPER_ROOT)/ace/ACE.h \ - $(WRAPPER_ROOT)/ace/OS.h \ - $(WRAPPER_ROOT)/ace/Time_Value.h \ - $(WRAPPER_ROOT)/ace/config.h \ - $(WRAPPER_ROOT)/ace/stdcpp.h \ - $(WRAPPER_ROOT)/ace/Trace.h \ - $(WRAPPER_ROOT)/ace/Log_Msg.h \ - $(WRAPPER_ROOT)/ace/Log_Record.h \ - $(WRAPPER_ROOT)/ace/Log_Priority.h \ - $(WRAPPER_ROOT)/ace/Log_Record.i \ - $(WRAPPER_ROOT)/ace/ACE.i \ - $(WRAPPER_ROOT)/ace/IPC_SAP.i \ - $(WRAPPER_ROOT)/ace/Addr.h \ - $(WRAPPER_ROOT)/ace/TLI.i \ - $(WRAPPER_ROOT)/ace/INET_Addr.h \ - $(WRAPPER_ROOT)/ace/TLI_Stream.i \ - $(WRAPPER_ROOT)/ace/TLI_Connector.i -.obj/db-server.o .shobj/db-server.so: db-server.cpp \ - $(WRAPPER_ROOT)/ace/TLI_Acceptor.h \ - $(WRAPPER_ROOT)/ace/TLI.h \ - $(WRAPPER_ROOT)/ace/IPC_SAP.h \ - $(WRAPPER_ROOT)/ace/ACE.h \ - $(WRAPPER_ROOT)/ace/OS.h \ - $(WRAPPER_ROOT)/ace/Time_Value.h \ - $(WRAPPER_ROOT)/ace/config.h \ - $(WRAPPER_ROOT)/ace/stdcpp.h \ - $(WRAPPER_ROOT)/ace/Trace.h \ - $(WRAPPER_ROOT)/ace/Log_Msg.h \ - $(WRAPPER_ROOT)/ace/Log_Record.h \ - $(WRAPPER_ROOT)/ace/Log_Priority.h \ - $(WRAPPER_ROOT)/ace/Log_Record.i \ - $(WRAPPER_ROOT)/ace/ACE.i \ - $(WRAPPER_ROOT)/ace/IPC_SAP.i \ - $(WRAPPER_ROOT)/ace/Addr.h \ - $(WRAPPER_ROOT)/ace/TLI.i \ - $(WRAPPER_ROOT)/ace/TLI_Stream.h \ - $(WRAPPER_ROOT)/ace/INET_Addr.h \ - $(WRAPPER_ROOT)/ace/TLI_Stream.i \ - $(WRAPPER_ROOT)/ace/TLI_Acceptor.i \ - $(WRAPPER_ROOT)/ace/Thread_Manager.h \ - $(WRAPPER_ROOT)/ace/Thread.h \ - $(WRAPPER_ROOT)/ace/Synch.h \ - $(WRAPPER_ROOT)/ace/SV_Semaphore_Complex.h \ - $(WRAPPER_ROOT)/ace/SV_Semaphore_Simple.h \ - $(WRAPPER_ROOT)/ace/SV_Semaphore_Simple.i \ - $(WRAPPER_ROOT)/ace/SV_Semaphore_Complex.i \ - $(WRAPPER_ROOT)/ace/Synch_T.h \ - $(WRAPPER_ROOT)/ace/Event_Handler.h -.obj/CPP-client.o .shobj/CPP-client.so: CPP-client.cpp \ - $(WRAPPER_ROOT)/ace/TLI_Connector.h \ - $(WRAPPER_ROOT)/ace/TLI_Stream.h \ - $(WRAPPER_ROOT)/ace/TLI.h \ - $(WRAPPER_ROOT)/ace/IPC_SAP.h \ - $(WRAPPER_ROOT)/ace/ACE.h \ - $(WRAPPER_ROOT)/ace/OS.h \ - $(WRAPPER_ROOT)/ace/Time_Value.h \ - $(WRAPPER_ROOT)/ace/config.h \ - $(WRAPPER_ROOT)/ace/stdcpp.h \ - $(WRAPPER_ROOT)/ace/Trace.h \ - $(WRAPPER_ROOT)/ace/Log_Msg.h \ - $(WRAPPER_ROOT)/ace/Log_Record.h \ - $(WRAPPER_ROOT)/ace/Log_Priority.h \ - $(WRAPPER_ROOT)/ace/Log_Record.i \ - $(WRAPPER_ROOT)/ace/ACE.i \ - $(WRAPPER_ROOT)/ace/IPC_SAP.i \ - $(WRAPPER_ROOT)/ace/Addr.h \ - $(WRAPPER_ROOT)/ace/TLI.i \ - $(WRAPPER_ROOT)/ace/INET_Addr.h \ - $(WRAPPER_ROOT)/ace/TLI_Stream.i \ - $(WRAPPER_ROOT)/ace/TLI_Connector.i -.obj/CPP-server.o .shobj/CPP-server.so: CPP-server.cpp \ - $(WRAPPER_ROOT)/ace/TLI_Acceptor.h \ - $(WRAPPER_ROOT)/ace/TLI.h \ - $(WRAPPER_ROOT)/ace/IPC_SAP.h \ - $(WRAPPER_ROOT)/ace/ACE.h \ - $(WRAPPER_ROOT)/ace/OS.h \ - $(WRAPPER_ROOT)/ace/Time_Value.h \ - $(WRAPPER_ROOT)/ace/config.h \ - $(WRAPPER_ROOT)/ace/stdcpp.h \ - $(WRAPPER_ROOT)/ace/Trace.h \ - $(WRAPPER_ROOT)/ace/Log_Msg.h \ - $(WRAPPER_ROOT)/ace/Log_Record.h \ - $(WRAPPER_ROOT)/ace/Log_Priority.h \ - $(WRAPPER_ROOT)/ace/Log_Record.i \ - $(WRAPPER_ROOT)/ace/ACE.i \ - $(WRAPPER_ROOT)/ace/IPC_SAP.i \ - $(WRAPPER_ROOT)/ace/Addr.h \ - $(WRAPPER_ROOT)/ace/TLI.i \ - $(WRAPPER_ROOT)/ace/TLI_Stream.h \ - $(WRAPPER_ROOT)/ace/INET_Addr.h \ - $(WRAPPER_ROOT)/ace/TLI_Stream.i \ - $(WRAPPER_ROOT)/ace/TLI_Acceptor.i - -# IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/examples/IPC_SAP/TLI_SAP/db-client.cpp b/examples/IPC_SAP/TLI_SAP/db-client.cpp deleted file mode 100644 index 4e37630b43d..00000000000 --- a/examples/IPC_SAP/TLI_SAP/db-client.cpp +++ /dev/null @@ -1,52 +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_ERROR_RETURN ((LM_ERROR, "Usage: %s employee_id [server-host port-number]\n", - argv[0]), -1); - - const char *emp_num = 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]); - int n; - char buf[MAXLINE]; - - ACE_TLI_Stream client; - ACE_TLI_Connector con; - - if (con.connect (client, ACE_INET_Addr (port, host_name)) == -1) - ACE_OS::t_error ((char *)host_name), ACE_OS::exit (1); - - ACE_OS::strcpy (buf, emp_num); - n = ACE_OS::strlen (buf); - - if (client.send_n (buf, n) != n) - ACE_OS::t_error ("client.send error"); - - if (client.recv (buf, MAXLINE) == -1 && t_errno != TLOOK && client.look () != T_DISCONNECT) - ACE_OS::t_error ("client.recv error"); - - if (ACE_OS::strcmp (buf, "ERROR") == 0) - ACE_OS::printf ("Employee ID %s not in database\n", emp_num); - else - ACE_OS::printf ("Employee name requested is: %s\n", buf); - - 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 must support ACE_TLI\n"), 1); -} -#endif /* ACE_HAS_TLI */ diff --git a/examples/IPC_SAP/TLI_SAP/db-server.cpp b/examples/IPC_SAP/TLI_SAP/db-server.cpp deleted file mode 100644 index 83cf8d1e31a..00000000000 --- a/examples/IPC_SAP/TLI_SAP/db-server.cpp +++ /dev/null @@ -1,111 +0,0 @@ -/* Simple multi-threaded database server example. */ -// $Id$ - - -#include "ace/TLI_Acceptor.h" -#include "ace/Thread_Manager.h" - -#if defined (ACE_HAS_THREADS) && defined (ACE_HAS_TLI) - -/* Global thread manager. */ -ACE_Thread_Manager thr_mgr; - -void * -lookup_name (ACE_HANDLE handle) -{ - ACE_Thread_Control tc (&thr_mgr); - - enum - { - MAXLINE = 255, - EMPNAMELEN = 512 - }; - - static struct - { - int emp_id; - const char emp_name[EMPNAMELEN]; - } employee_db[] = - { - {123, "John Wayne Bobbit"}, - {124, "Cindy Crawford"}, - {125, "O. J. Simpson"}, - {126, "Bill Clinton"}, - {127, "Rush Limbaugh"}, - {128, "Michael Jackson"}, - {129, "George Burns"}, - {130, "Paula Jones"}, - {0, ""} - }; - - int n; - int flags; - int len; - int employee_id; - int index; - int found; - ACE_TLI_Stream stream; - char recvline[MAXLINE]; - char sendline[MAXLINE]; - - ACE_DEBUG ((LM_DEBUG, "stream handle = %d, thread id = %t\n", handle)); - stream.set_handle (handle); - - if ((n = stream.recv (recvline, MAXLINE, &flags)) == -1) - ACE_OS::t_error ("stream.recv error"); - - employee_id = ACE_OS::atoi (recvline); - found = 0; - - for (index = 0; found == 0 && employee_db[index].emp_id; index++) - if (employee_id == employee_db[index].emp_id) - { - found = 1; - n = ACE_OS::sprintf (sendline, "%s", employee_db[index].emp_name); - } - - if (found == 0) - n = ACE_OS::sprintf (sendline, "%s", "ERROR"); - - if ((len = stream.send (sendline, n + 1, 0)) == -1) - ACE_OS::t_error ("stream.send error"); - - if (stream.sndrel () == -1) - ACE_OS::t_error ("stream.send error"); - - if (stream.close () == -1) - ACE_OS::t_error ("stream.close error"); - - return 0; -} - -int -main (int argc, char *argv[]) -{ - u_short port = argc > 1 ? ACE_OS::atoi (argv[1]) : ACE_DEFAULT_SERVER_PORT; - ACE_INET_Addr l_addr (port); - ACE_TLI_Acceptor server (l_addr, 1); // Create server, reuse addr if in use. - ACE_TLI_Stream new_stream; - - // Wait for a connection from a client. This is an example of a - // concurrent server. - - for (;;) - { - if (server.accept (new_stream) == -1) - ::t_error ("server.accept error"); - - if (thr_mgr.spawn (ACE_THR_FUNC (lookup_name), - (void *) new_stream.get_handle (), - THR_DETACHED) == -1) - ACE_DEBUG ((LM_ERROR, "server: can't create worker thread %d\n")); - } - return 0; -} -#else -#include <stdio.h> -int main (void) -{ - ACE_ERROR_RETURN ((LM_ERROR, "your platform must support ACE_TLI\n"), 1); -} -#endif /* ACE_HAS_THREADS */ 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 */ diff --git a/examples/IPC_SAP/TLI_SAP/ftp-server.cpp b/examples/IPC_SAP/TLI_SAP/ftp-server.cpp deleted file mode 100644 index 046f4dc0464..00000000000 --- a/examples/IPC_SAP/TLI_SAP/ftp-server.cpp +++ /dev/null @@ -1,75 +0,0 @@ -/* Simple file transfer example */ -// $Id$ - - -#include "ace/Thread_Manager.h" -#include "ace/TLI_Acceptor.h" - -#if defined (ACE_HAS_THREADS) && defined (ACE_HAS_TLI) - -ACE_Thread_Manager thr_mgr; - -void * -read_file (void *fd) -{ - ACE_Thread_Control tc (&thr_mgr); - ACE_TLI_Stream stream; - char buf[BUFSIZ]; - int flags = 0; - int n; - - stream.set_handle (int (fd)); - - ACE_OS::printf ("start (tid = %d, fd = %d)\n", ACE_OS::thr_self (), stream.get_handle ()); - ACE_OS::fflush (stdout); - - while ((n = stream.recv (buf, sizeof buf, &flags)) > 0) - continue; - - ACE_OS::printf ("finish (tid = %d, fd = %d)\n", ACE_OS::thr_self (), stream.get_handle ()); - - if (stream.close () == -1) - ACE_OS::t_error ("stream.close error"); - - return 0; -} - -int -main (int argc, char *argv[]) -{ - u_short port = argc > 1 ? ACE_OS::atoi (argv[1]) : ACE_DEFAULT_SERVER_PORT; - ACE_TLI_Acceptor server; - ACE_TLI_Stream new_stream; - - /* Allow up to 100 simultaneous threads */ - if (thr_mgr.open (100) == -1) - ACE_OS::perror ("thr_mgr.open"), ACE_OS::exit (1); - - // Open the server and reuse the address if in use... - if (server.open (ACE_INET_Addr (port), 1) == -1) - ACE_OS::t_error ("server.open"), ACE_OS::exit (1); - - /* Wait for a connection from a client. This is an example of a concurrent server */ - - for (int count = 1; ; count++) - { - ACE_OS::fprintf (stderr, "thread %d, blocking for accept #%d\n", - ACE_OS::thr_self (), count); - - if (server.accept (new_stream) == -1) - ACE_OS::t_error ("server.accept error"); - - else if (thr_mgr.spawn (ACE_THR_FUNC (read_file), - (void *) new_stream.get_handle (), - THR_DETACHED | THR_BOUND) == -1) - ACE_OS::perror ("can't create worker thread\n"); - } - return 0; -} -#else -#include <stdio.h> -int main (void) -{ - ACE_ERROR_RETURN ((LM_ERROR, "your platform must support ACE_TLI\n"), 1); -} -#endif /* ACE_HAS_THREADS */ diff --git a/examples/IPC_SAP/TLI_SAP/signal_thread.c b/examples/IPC_SAP/TLI_SAP/signal_thread.c deleted file mode 100644 index e3a3485f1a2..00000000000 --- a/examples/IPC_SAP/TLI_SAP/signal_thread.c +++ /dev/null @@ -1,53 +0,0 @@ -#define _REENTRANT -// @(#)signal_thread.c 1.1 10/18/96 - -#include <stdio.h> -#include <stdlib.h> -#include <signal.h> -#include <thread.h> -#include <synch.h> -#include <unistd.h> - -void *handle (v) - void *v; -{ - sigset_t set; - - sigemptyset (&set); - sigaddset (&set, SIGINT); - - for (;;) - if (sigwait (&set) != SIGINT) - perror ("sigwait"), exit (1); - else - fprintf (stderr, "got sigint!\n"); -} - -int -main (void) -{ - int retval; - sigset_t set; - thread_t t_id; - - sigemptyset (&set); - sigaddset (&set, SIGINT); - - if (sigprocmask (SIG_BLOCK, &set, 0) == -1) - perror ("sigprocmask"), exit (1); - - if (thr_sigsetmask (SIG_BLOCK, &set, 0) == -1) - perror ("sigprocmask"), exit (1); - - if (thr_create (0, 0, handle, 0, THR_DETACHED, &t_id) != 0) - perror ("thr_create"), exit (1); - - for (;;) - { - fprintf (stderr, "blocking for read in thread\n"); - if (read (0, &retval, sizeof retval) != sizeof retval) - perror ("read"); - } - fprintf (stderr, "I'm exiting!\n"); - return 0; -} diff --git a/examples/IPC_SAP/UPIPE_SAP/Makefile b/examples/IPC_SAP/UPIPE_SAP/Makefile deleted file mode 100644 index 06ac8fb11cd..00000000000 --- a/examples/IPC_SAP/UPIPE_SAP/Makefile +++ /dev/null @@ -1,198 +0,0 @@ -#---------------------------------------------------------------------------- -# @(#)Makefile 1.1 10/18/96 -# -# Makefile for the simple ACE_UPIPE client/server test file -#---------------------------------------------------------------------------- - -#---------------------------------------------------------------------------- -# Local macros -#---------------------------------------------------------------------------- - -BIN = ex1 \ - ex2 \ - ex3 - -LSRC = $(addsuffix .cpp,$(BIN)) - -VLDLIBS = $(LDLIBS:%=%$(VAR)) - -BUILD = $(VBIN) - -#---------------------------------------------------------------------------- -# Include macros and targets -#---------------------------------------------------------------------------- - -include $(WRAPPER_ROOT)/include/makeinclude/wrapper_macros.GNU -include $(WRAPPER_ROOT)/include/makeinclude/macros.GNU -include $(WRAPPER_ROOT)/include/makeinclude/rules.common.GNU -include $(WRAPPER_ROOT)/include/makeinclude/rules.nonested.GNU -include $(WRAPPER_ROOT)/include/makeinclude/rules.bin.GNU -include $(WRAPPER_ROOT)/include/makeinclude/rules.local.GNU - -#---------------------------------------------------------------------------- -# Local targets -#---------------------------------------------------------------------------- - -#---------------------------------------------------------------------------- -# Dependencies -#---------------------------------------------------------------------------- -# DO NOT DELETE THIS LINE -- g++dep uses it. -# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. - -.obj/ex1.o .shobj/ex1.so: ex1.cpp \ - $(WRAPPER_ROOT)/ace/Stream.h \ - $(WRAPPER_ROOT)/ace/ACE.h \ - $(WRAPPER_ROOT)/ace/OS.h \ - $(WRAPPER_ROOT)/ace/Time_Value.h \ - $(WRAPPER_ROOT)/ace/config.h \ - $(WRAPPER_ROOT)/ace/stdcpp.h \ - $(WRAPPER_ROOT)/ace/Trace.h \ - $(WRAPPER_ROOT)/ace/Log_Msg.h \ - $(WRAPPER_ROOT)/ace/Log_Record.h \ - $(WRAPPER_ROOT)/ace/Log_Priority.h \ - $(WRAPPER_ROOT)/ace/Log_Record.i \ - $(WRAPPER_ROOT)/ace/ACE.i \ - $(WRAPPER_ROOT)/ace/IO_Cntl_Msg.h \ - $(WRAPPER_ROOT)/ace/Message_Block.h \ - $(WRAPPER_ROOT)/ace/Malloc.h \ - $(WRAPPER_ROOT)/ace/Malloc_T.h \ - $(WRAPPER_ROOT)/ace/Synch.h \ - $(WRAPPER_ROOT)/ace/SV_Semaphore_Complex.h \ - $(WRAPPER_ROOT)/ace/SV_Semaphore_Simple.h \ - $(WRAPPER_ROOT)/ace/SV_Semaphore_Simple.i \ - $(WRAPPER_ROOT)/ace/SV_Semaphore_Complex.i \ - $(WRAPPER_ROOT)/ace/Synch_T.h \ - $(WRAPPER_ROOT)/ace/Event_Handler.h \ - $(WRAPPER_ROOT)/ace/Memory_Pool.h \ - $(WRAPPER_ROOT)/ace/Signal.h \ - $(WRAPPER_ROOT)/ace/Set.h \ - $(WRAPPER_ROOT)/ace/Mem_Map.h \ - $(WRAPPER_ROOT)/ace/Module.h \ - $(WRAPPER_ROOT)/ace/Task.h \ - $(WRAPPER_ROOT)/ace/Service_Object.h \ - $(WRAPPER_ROOT)/ace/Shared_Object.h \ - $(WRAPPER_ROOT)/ace/Thread_Manager.h \ - $(WRAPPER_ROOT)/ace/Thread.h \ - $(WRAPPER_ROOT)/ace/Task_T.h \ - $(WRAPPER_ROOT)/ace/Message_Queue.h \ - $(WRAPPER_ROOT)/ace/UPIPE_Acceptor.h \ - $(WRAPPER_ROOT)/ace/UPIPE_Stream.h \ - $(WRAPPER_ROOT)/ace/SPIPE.h \ - $(WRAPPER_ROOT)/ace/IPC_SAP.h \ - $(WRAPPER_ROOT)/ace/IPC_SAP.i \ - $(WRAPPER_ROOT)/ace/SPIPE_Addr.h \ - $(WRAPPER_ROOT)/ace/Addr.h \ - $(WRAPPER_ROOT)/ace/SPIPE.i \ - $(WRAPPER_ROOT)/ace/UPIPE_Addr.h \ - $(WRAPPER_ROOT)/ace/SPIPE_Acceptor.h \ - $(WRAPPER_ROOT)/ace/SPIPE_Stream.h \ - $(WRAPPER_ROOT)/ace/SPIPE_Stream.i \ - $(WRAPPER_ROOT)/ace/UPIPE_Acceptor.i \ - $(WRAPPER_ROOT)/ace/UPIPE_Connector.h \ - $(WRAPPER_ROOT)/ace/UPIPE_Connector.i -.obj/ex2.o .shobj/ex2.so: ex2.cpp \ - $(WRAPPER_ROOT)/ace/UPIPE_Connector.h \ - $(WRAPPER_ROOT)/ace/UPIPE_Stream.h \ - $(WRAPPER_ROOT)/ace/Stream.h \ - $(WRAPPER_ROOT)/ace/ACE.h \ - $(WRAPPER_ROOT)/ace/OS.h \ - $(WRAPPER_ROOT)/ace/Time_Value.h \ - $(WRAPPER_ROOT)/ace/config.h \ - $(WRAPPER_ROOT)/ace/stdcpp.h \ - $(WRAPPER_ROOT)/ace/Trace.h \ - $(WRAPPER_ROOT)/ace/Log_Msg.h \ - $(WRAPPER_ROOT)/ace/Log_Record.h \ - $(WRAPPER_ROOT)/ace/Log_Priority.h \ - $(WRAPPER_ROOT)/ace/Log_Record.i \ - $(WRAPPER_ROOT)/ace/ACE.i \ - $(WRAPPER_ROOT)/ace/IO_Cntl_Msg.h \ - $(WRAPPER_ROOT)/ace/Message_Block.h \ - $(WRAPPER_ROOT)/ace/Malloc.h \ - $(WRAPPER_ROOT)/ace/Malloc_T.h \ - $(WRAPPER_ROOT)/ace/Synch.h \ - $(WRAPPER_ROOT)/ace/SV_Semaphore_Complex.h \ - $(WRAPPER_ROOT)/ace/SV_Semaphore_Simple.h \ - $(WRAPPER_ROOT)/ace/SV_Semaphore_Simple.i \ - $(WRAPPER_ROOT)/ace/SV_Semaphore_Complex.i \ - $(WRAPPER_ROOT)/ace/Synch_T.h \ - $(WRAPPER_ROOT)/ace/Event_Handler.h \ - $(WRAPPER_ROOT)/ace/Memory_Pool.h \ - $(WRAPPER_ROOT)/ace/Signal.h \ - $(WRAPPER_ROOT)/ace/Set.h \ - $(WRAPPER_ROOT)/ace/Mem_Map.h \ - $(WRAPPER_ROOT)/ace/Module.h \ - $(WRAPPER_ROOT)/ace/Task.h \ - $(WRAPPER_ROOT)/ace/Service_Object.h \ - $(WRAPPER_ROOT)/ace/Shared_Object.h \ - $(WRAPPER_ROOT)/ace/Thread_Manager.h \ - $(WRAPPER_ROOT)/ace/Thread.h \ - $(WRAPPER_ROOT)/ace/Task_T.h \ - $(WRAPPER_ROOT)/ace/Message_Queue.h \ - $(WRAPPER_ROOT)/ace/SPIPE.h \ - $(WRAPPER_ROOT)/ace/IPC_SAP.h \ - $(WRAPPER_ROOT)/ace/IPC_SAP.i \ - $(WRAPPER_ROOT)/ace/SPIPE_Addr.h \ - $(WRAPPER_ROOT)/ace/Addr.h \ - $(WRAPPER_ROOT)/ace/SPIPE.i \ - $(WRAPPER_ROOT)/ace/UPIPE_Addr.h \ - $(WRAPPER_ROOT)/ace/SPIPE_Stream.h \ - $(WRAPPER_ROOT)/ace/SPIPE_Stream.i \ - $(WRAPPER_ROOT)/ace/UPIPE_Connector.i \ - $(WRAPPER_ROOT)/ace/UPIPE_Acceptor.h \ - $(WRAPPER_ROOT)/ace/SPIPE_Acceptor.h \ - $(WRAPPER_ROOT)/ace/UPIPE_Acceptor.i \ - auto_builtin_ptr.h -.obj/ex3.o .shobj/ex3.so: ex3.cpp \ - $(WRAPPER_ROOT)/ace/UPIPE_Connector.h \ - $(WRAPPER_ROOT)/ace/UPIPE_Stream.h \ - $(WRAPPER_ROOT)/ace/Stream.h \ - $(WRAPPER_ROOT)/ace/ACE.h \ - $(WRAPPER_ROOT)/ace/OS.h \ - $(WRAPPER_ROOT)/ace/Time_Value.h \ - $(WRAPPER_ROOT)/ace/config.h \ - $(WRAPPER_ROOT)/ace/stdcpp.h \ - $(WRAPPER_ROOT)/ace/Trace.h \ - $(WRAPPER_ROOT)/ace/Log_Msg.h \ - $(WRAPPER_ROOT)/ace/Log_Record.h \ - $(WRAPPER_ROOT)/ace/Log_Priority.h \ - $(WRAPPER_ROOT)/ace/Log_Record.i \ - $(WRAPPER_ROOT)/ace/ACE.i \ - $(WRAPPER_ROOT)/ace/IO_Cntl_Msg.h \ - $(WRAPPER_ROOT)/ace/Message_Block.h \ - $(WRAPPER_ROOT)/ace/Malloc.h \ - $(WRAPPER_ROOT)/ace/Malloc_T.h \ - $(WRAPPER_ROOT)/ace/Synch.h \ - $(WRAPPER_ROOT)/ace/SV_Semaphore_Complex.h \ - $(WRAPPER_ROOT)/ace/SV_Semaphore_Simple.h \ - $(WRAPPER_ROOT)/ace/SV_Semaphore_Simple.i \ - $(WRAPPER_ROOT)/ace/SV_Semaphore_Complex.i \ - $(WRAPPER_ROOT)/ace/Synch_T.h \ - $(WRAPPER_ROOT)/ace/Event_Handler.h \ - $(WRAPPER_ROOT)/ace/Memory_Pool.h \ - $(WRAPPER_ROOT)/ace/Signal.h \ - $(WRAPPER_ROOT)/ace/Set.h \ - $(WRAPPER_ROOT)/ace/Mem_Map.h \ - $(WRAPPER_ROOT)/ace/Module.h \ - $(WRAPPER_ROOT)/ace/Task.h \ - $(WRAPPER_ROOT)/ace/Service_Object.h \ - $(WRAPPER_ROOT)/ace/Shared_Object.h \ - $(WRAPPER_ROOT)/ace/Thread_Manager.h \ - $(WRAPPER_ROOT)/ace/Thread.h \ - $(WRAPPER_ROOT)/ace/Task_T.h \ - $(WRAPPER_ROOT)/ace/Message_Queue.h \ - $(WRAPPER_ROOT)/ace/SPIPE.h \ - $(WRAPPER_ROOT)/ace/IPC_SAP.h \ - $(WRAPPER_ROOT)/ace/IPC_SAP.i \ - $(WRAPPER_ROOT)/ace/SPIPE_Addr.h \ - $(WRAPPER_ROOT)/ace/Addr.h \ - $(WRAPPER_ROOT)/ace/SPIPE.i \ - $(WRAPPER_ROOT)/ace/UPIPE_Addr.h \ - $(WRAPPER_ROOT)/ace/SPIPE_Stream.h \ - $(WRAPPER_ROOT)/ace/SPIPE_Stream.i \ - $(WRAPPER_ROOT)/ace/UPIPE_Connector.i \ - $(WRAPPER_ROOT)/ace/UPIPE_Acceptor.h \ - $(WRAPPER_ROOT)/ace/SPIPE_Acceptor.h \ - $(WRAPPER_ROOT)/ace/UPIPE_Acceptor.i \ - auto_builtin_ptr.h - -# IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/examples/IPC_SAP/UPIPE_SAP/auto_builtin_ptr.h b/examples/IPC_SAP/UPIPE_SAP/auto_builtin_ptr.h deleted file mode 100644 index b8d82470d58..00000000000 --- a/examples/IPC_SAP/UPIPE_SAP/auto_builtin_ptr.h +++ /dev/null @@ -1,20 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -template <class X> -class auto_builtin_ptr - // = TITLE - // Implements an simple-minded auto_ptr abstraction for builtin types. -{ -public: - // = Initialization and termination methods - auto_builtin_ptr (X *p = 0): p_ (p) {} - ~auto_builtin_ptr (void) { delete [] this->p_; } - - // = Accessor methods. - operator X * (void) const { return this->p_; } - -private: - X *p_; -}; - diff --git a/examples/IPC_SAP/UPIPE_SAP/ex1.cpp b/examples/IPC_SAP/UPIPE_SAP/ex1.cpp deleted file mode 100644 index ba5490504c3..00000000000 --- a/examples/IPC_SAP/UPIPE_SAP/ex1.cpp +++ /dev/null @@ -1,155 +0,0 @@ -// Example for using ACE_UPIPE_SAP and ACE_Thread for intra-process -// $Id$ - -// communication. -// -// Author : Gerhard Lenzer and Douglas C. Schmidt - - -#include "ace/Stream.h" -#include "ace/UPIPE_Acceptor.h" -#include "ace/UPIPE_Connector.h" - -#if defined (ACE_HAS_THREADS) - -// Global thread manager. -static ACE_Thread_Manager thr_mgr; - -//ACE_UPIPE_Manager ltc_mgr; - -// Global pattern -static ACE_UPIPE_Addr addr ("pattern"); - -// peer1 thread. - -static void * -peer1 (void *) -{ - // Insert thread into thr_mgr. - ACE_Thread_Control thread_control (&thr_mgr); - ACE_UPIPE_Stream c_stream; - - ACE_UPIPE_Addr c_addr ("pattern"); - - ACE_DEBUG ((LM_DEBUG, "(%t) peer1 starting connect\n")); - ACE_UPIPE_Connector con; - - if (con.connect (c_stream, addr) == -1) - ACE_DEBUG ((LM_DEBUG, "(%t) peer1 ACE_UPIPE_Connector failed\n")); - - ACE_Message_Block *mb = new ACE_Message_Block (20); - mb->copy ("hello", 6); - - if (c_stream.send (mb) == -1) - ACE_DEBUG ((LM_DEBUG, "(%t) error peer1 send\n")); - - if (c_stream.recv (mb) == -1) - ACE_DEBUG ((LM_DEBUG, "(%t) error peer1 recv\n")); - - ACE_DEBUG ((LM_DEBUG, "(%t) peer1 ack is \"%s\"\n", mb->rd_ptr ())); - - // Free up the memory block. - delete mb; - - // Now try the send()/recv() interface. - char mytext[] = "This string is sent by peer1 as buffer"; - - ACE_DEBUG ((LM_DEBUG, "(%t) peer1 sending text\n")); - if (c_stream.send (mytext, sizeof mytext) == -1) - ACE_DEBUG ((LM_DEBUG, - "(%t) buffer send from peer1 failed\n")); - - char conbuf[30]; // Buffer to receive response. - - int i = 0; - - for (char c = ' '; c != '!'; i++) - { - if (c_stream.recv (&c, 1) == -1) - ACE_DEBUG ((LM_DEBUG, - "(%t) buffer recv from peer1 failed\n")); - else - conbuf[i] = c; - } - - conbuf[i] = '\0'; - ACE_DEBUG ((LM_DEBUG, - "(%t) peer1 received buffer with \"%s\"\n", - conbuf)); - c_stream.close (); - return 0; -} - -static void * -peer2 (void *) -{ - // Insert thread into thr_mgr. - ACE_Thread_Control thread_control (&thr_mgr); - - ACE_UPIPE_Addr serv_addr ("pattern"); - ACE_UPIPE_Acceptor acc (addr); - ACE_UPIPE_Stream s_stream; - - // Spawn a peer1 thread. - if (thr_mgr.spawn (ACE_THR_FUNC (peer1), (void *) 0, - THR_NEW_LWP | THR_DETACHED) == -1) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "spawn"), 0); - - ACE_DEBUG ((LM_DEBUG, "(%t) peer2 starting accept\n")); - - if (acc.accept (s_stream) == -1) - ACE_DEBUG ((LM_DEBUG, - "(%t) ACE_UPIPE_Acceptor.accept failed\n")); - - ACE_Message_Block *mb = 0; - - if (s_stream.recv (mb) == -1) - ACE_DEBUG ((LM_DEBUG, "(%t) peer2 recv failed\n")); - - ACE_DEBUG ((LM_DEBUG, "(%t) peer2 recv is \"%s\"\n", - mb->rd_ptr ())); - - mb->wr_ptr (mb->rd_ptr ()); - mb->copy ("thanks", 7); - - if (s_stream.send (mb) == -1) - ACE_DEBUG ((LM_DEBUG, "(%t) peer2 send failed\n")); - - char s_buf[42]; - ACE_DEBUG ((LM_DEBUG, "(%t) peer2 sleeping on recv\n")); - - if (s_stream.recv (s_buf, sizeof s_buf) == -1) - ACE_DEBUG ((LM_DEBUG, "(%t) peer2 recv failed\n")); - else - ACE_DEBUG ((LM_DEBUG, - "(%t) peer2 received buffer with \"%s\"\n", - s_buf)); - - ACE_OS::strcpy (s_buf, "this is the peer2 response!"); - - if (s_stream.send (s_buf, 30) == -1) - ACE_DEBUG ((LM_DEBUG, "(%t) peer2 send failed\n")); - - s_stream.close (); - return 0; -} - -int -main (int, char *[]) -{ - // Spawn a peer2 thread. - if (thr_mgr.spawn (ACE_THR_FUNC (peer2), (void *) 0, - THR_NEW_LWP | THR_DETACHED) == -1) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "spawn"), 1); - - // Wait for peer2 and peer1 threads to exit. - thr_mgr.wait (); - return 0; -} -#else -int -main (int, char *[]) -{ - ACE_ERROR_RETURN ((LM_ERROR, "threads not supported on this platform\n"), -1); -} -#endif /* ACE_HAS_THREADS */ diff --git a/examples/IPC_SAP/UPIPE_SAP/ex2.cpp b/examples/IPC_SAP/UPIPE_SAP/ex2.cpp deleted file mode 100644 index 63e37e7089a..00000000000 --- a/examples/IPC_SAP/UPIPE_SAP/ex2.cpp +++ /dev/null @@ -1,153 +0,0 @@ -// Example for using ACE_UPIPE_SAP and ACE_Thread for intra-process -// $Id$ - -// communication. -// -// Author : Gerhard Lenzer and Douglas C. Schmidt - -#include <fstream.h> - -#include "ace/UPIPE_Connector.h" -#include "ace/UPIPE_Acceptor.h" -#include "auto_builtin_ptr.h" - -#if defined (ACE_HAS_THREADS) - -// Global thread manager. -static ACE_Thread_Manager thr_mgr; - -// Data for testsuite. -int size = 0; -int iterations = 0; - -static void * -supplier (void *) -{ - // Insert thread into thr_mgr. - ACE_Thread_Control thread_control (&thr_mgr); - ACE_UPIPE_Stream s_stream; - - ACE_UPIPE_Addr c_addr ("pattern"); - - auto_builtin_ptr <char> mybuf = new char[size]; - - for (int i = 0; i < size; i++) - mybuf[i] = 'a'; - - ACE_DEBUG ((LM_DEBUG, "(%t) supplier starting connect thread\n")); - - ACE_UPIPE_Connector con; - - if (con.connect (s_stream, c_addr) == -1) - ACE_DEBUG ((LM_DEBUG, "(%t) %p\n", - "ACE_UPIPE_Acceptor.connect failed")); - - // Test asynchronisity. - s_stream.enable (SIGIO); - - for (int j = 0; j < iterations; j++) - { - ACE_Message_Block *mb_p = - new ACE_Message_Block (size, ACE_Message_Block::MB_DATA, - (ACE_Message_Block *) 0, mybuf); - - if (s_stream.send (mb_p) == -1) - { - ACE_DEBUG ((LM_DEBUG, "(%t) %p\n", "send failed")); - return 0; - } - } - - // Insert a 0-sized message block to signal the other side to shut - // down. - if (s_stream.send (new ACE_Message_Block ((size_t) 0)) == -1) - { - cout << "error put" << endl; - return 0; - } - - s_stream.close (); - return 0; -} - -static void * -consumer (void *) -{ - // Insert thread into thr_mgr. - ACE_Thread_Control thread_control (&thr_mgr); - ACE_UPIPE_Stream c_stream; - - // Set the high water mark to size to achieve optimum performance. - - int wm = size * iterations; - - if (c_stream.control (ACE_IO_Cntl_Msg::SET_HWM, &wm) == -1) - ACE_DEBUG ((LM_DEBUG, "set HWM failed\n")); - - ACE_UPIPE_Addr serv_addr ("pattern"); - - ACE_UPIPE_Acceptor acc (serv_addr); // accept will wait up to 4 seconds - - ACE_DEBUG ((LM_DEBUG, "(%t) consumer spawning the supplier thread\n")); - - // Spawn the supplier thread. - if (thr_mgr.spawn (ACE_THR_FUNC (supplier), (void *) 0, - THR_NEW_LWP | THR_DETACHED) == -1) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "spawn"), 0); - - ACE_DEBUG ((LM_DEBUG, "(%t) consumer starting accept\n")); - - if (acc.accept (c_stream) == -1) - ACE_DEBUG ((LM_DEBUG, "(%t) %p\n", - "ACE_UPIPE_Acceptor.accept failed")); - - // time measurement - time_t currsec; - ACE_OS::time (&currsec); - time_t start = (time_t) currsec; - - int received_messages = 0; - - for (ACE_Message_Block *mb = 0; - c_stream.recv (mb) != -1 && mb->size () != 0; - delete mb) - received_messages++; - - ACE_OS::time (&currsec); - time_t secs = (time_t) currsec - start; - - ACE_DEBUG ((LM_DEBUG, - "(%t) Transferred %d blocks of size %d\n" - "The program ran %d seconds\n", - received_messages, size, secs)); - - c_stream.close (); - return 0; -} - -int -main (int argc, char *argv[]) -{ - size = argc > 1 ? ACE_OS::atoi (argv[1]) : 32; - iterations = argc > 2 ? ACE_OS::atoi (argv[2]) : 16; - - // Spawn the two threads. - if (thr_mgr.spawn (ACE_THR_FUNC (consumer), (void *) 0, - THR_NEW_LWP | THR_DETACHED) == -1) - ACE_ERROR_RETURN ( (LM_ERROR, "%p\n", "spawn"), 1); - - // Wait for producer and consumer threads to exit. - thr_mgr.wait (); - return 0; -} - -#else -int -main (int, char *[]) -{ - ACE_ERROR ( (LM_ERROR, "threads not supported on this platform\n")); - return 0; -} -#endif /* ACE_HAS_THREADS */ - - diff --git a/examples/IPC_SAP/UPIPE_SAP/ex3.cpp b/examples/IPC_SAP/UPIPE_SAP/ex3.cpp deleted file mode 100644 index f6999a2d73b..00000000000 --- a/examples/IPC_SAP/UPIPE_SAP/ex3.cpp +++ /dev/null @@ -1,147 +0,0 @@ -// Example for using ACE_UPIPE_SAP and ACE_Thread for intra-process -// $Id$ - -// communication. This example uses char buffers as input/output -// interface to the ACE_UPIPE_Stream -// -// Authors: Gerhard Lenzer and Prashant Jain. - -#include <fstream.h> - -#include "ace/UPIPE_Connector.h" -#include "ace/UPIPE_Acceptor.h" -#include "auto_builtin_ptr.h" - -#if defined (ACE_HAS_THREADS) - -// Global thread manager. -static ACE_Thread_Manager thr_mgr; - -// Data for testsuite. -int size = 0; -int iterations = 0; - -static void * -supplier (void *) -{ - // Insert thread into thr_mgr. - ACE_Thread_Control thread_control (&thr_mgr); - - ACE_UPIPE_Stream s_stream; - ACE_UPIPE_Addr c_addr ("pattern"); - - ACE_UPIPE_Connector con; - - ACE_DEBUG ((LM_DEBUG, "(%t) supplier starting connect thread\n")); - - if (con.connect (s_stream, c_addr) == -1) - ACE_DEBUG ((LM_DEBUG, "(%t) %p\n", - "ACE_UPIPE_Acceptor.connect failed")); - - auto_builtin_ptr <char> mybuf = new char[size]; - - for (int i = 0; i < size; i++) - mybuf[i] = 'a'; - - for (int j = 0; j < iterations; j++) - if (s_stream.send (mybuf, size) == -1) - { - ACE_DEBUG ((LM_DEBUG, "(%t) %p\n", "send failed")); - return 0; - } - - // Insert a 0-sized message block to signal the other side to shut - // down. - if (s_stream.send (new ACE_Message_Block ((size_t) 0)) == -1) - { - cout << "error put" << endl; - return 0; - } - - s_stream.close (); - return 0; -} - -static void * -consumer (void *) -{ - // Insert thread into thr_mgr. - ACE_Thread_Control thread_control (&thr_mgr); - - ACE_UPIPE_Stream c_stream; - ACE_UPIPE_Addr serv_addr ("pattern"); - - // Accept will wait up to 4 seconds - ACE_UPIPE_Acceptor acc (serv_addr); - - ACE_DEBUG ((LM_DEBUG, "(%t) consumer spawning the supplier thread\n")); - - // Spawn the supplier thread. - if (thr_mgr.spawn (ACE_THR_FUNC (supplier), (void *) 0, - THR_NEW_LWP | THR_DETACHED) == -1) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "spawn"), 0); - - ACE_DEBUG ((LM_DEBUG, "(%t) consumer starting accept\n")); - - if (acc.accept (c_stream) == -1) - ACE_DEBUG ((LM_DEBUG, "(%t) %p\n", - "ACE_UPIPE_Acceptor.accept failed")); - - // Ensure deletion upon exit. - auto_builtin_ptr <char> mybuf = new char[size]; - time_t currsec; - - ACE_OS::time (&currsec); - - time_t start = (time_t) currsec; - int result = 0; - int blocks = 0; - - for (;; blocks++) - { - result = c_stream.recv (mybuf, size); - if (result <= 0) - break; - // ACE_DEBUG ((LM_DEBUG, "(%t) %d: %s\n", size, (char *) mybuf)); - } - - if (result == -1) - ACE_DEBUG ((LM_DEBUG, "(%t) %p\n", "recv failed")); - - ACE_OS::time (&currsec); - time_t secs = (time_t) currsec - start; - - ACE_DEBUG ((LM_DEBUG, - "(%t) Transferred %d blocks of size %d\n" - "The program ran %d seconds\n", - blocks, size, secs)); - - c_stream.close (); - return 0; -} - -int -main (int argc, char *argv[]) -{ - size = argc > 1 ? ACE_OS::atoi (argv[1]) : 32; - iterations = argc > 2 ? ACE_OS::atoi (argv[2]) : 16; - - // Spawn the thread. - if (thr_mgr.spawn (ACE_THR_FUNC (consumer), (void *) 0, - THR_NEW_LWP | THR_DETACHED) == -1) - ACE_ERROR_RETURN ( (LM_ERROR, "%p\n", "spawn"), 1); - - // Wait for producer and consumer threads to exit. - thr_mgr.wait (); - return 0; -} -#else -int -main (int, char *[]) -{ - ACE_ERROR ( (LM_ERROR, "threads not supported on this platform\n")); - return 0; -} -#endif /* ACE_HAS_THREADS */ - - |