summaryrefslogtreecommitdiff
path: root/examples/IPC_SAP/FIFO_SAP
diff options
context:
space:
mode:
Diffstat (limited to 'examples/IPC_SAP/FIFO_SAP')
-rw-r--r--examples/IPC_SAP/FIFO_SAP/FIFO-Msg-client.cpp36
-rw-r--r--examples/IPC_SAP/FIFO_SAP/FIFO-Msg-server.cpp41
-rw-r--r--examples/IPC_SAP/FIFO_SAP/FIFO-client.cpp24
-rw-r--r--examples/IPC_SAP/FIFO_SAP/FIFO-server.cpp25
-rw-r--r--examples/IPC_SAP/FIFO_SAP/FIFO-test.cpp95
-rw-r--r--examples/IPC_SAP/FIFO_SAP/Makefile137
6 files changed, 0 insertions, 358 deletions
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