summaryrefslogtreecommitdiff
path: root/examples/C++NPv2
diff options
context:
space:
mode:
Diffstat (limited to 'examples/C++NPv2')
-rw-r--r--examples/C++NPv2/AC_CLD.dsp121
-rw-r--r--examples/C++NPv2/AC_CLD_export.h50
-rw-r--r--examples/C++NPv2/AC_Client_Logging_Daemon.cpp441
-rw-r--r--examples/C++NPv2/AIO_CLD.dsp113
-rw-r--r--examples/C++NPv2/AIO_CLD_export.h50
-rw-r--r--examples/C++NPv2/AIO_Client_Logging_Daemon.cpp437
-rw-r--r--examples/C++NPv2/CLD.dsp137
-rw-r--r--examples/C++NPv2/CLD_export.h34
-rw-r--r--examples/C++NPv2/Client_Logging_Daemon.cpp379
-rw-r--r--examples/C++NPv2/Configurable_Logging_Server.cpp20
-rw-r--r--examples/C++NPv2/Configurable_Logging_Server.dsp112
-rw-r--r--examples/C++NPv2/Logging_Acceptor.cpp38
-rw-r--r--examples/C++NPv2/Logging_Acceptor.h53
-rw-r--r--examples/C++NPv2/Logging_Acceptor_Ex.h41
-rw-r--r--examples/C++NPv2/Logging_Event_Handler.cpp43
-rw-r--r--examples/C++NPv2/Logging_Event_Handler.h61
-rw-r--r--examples/C++NPv2/Logging_Event_Handler_Ex.cpp40
-rw-r--r--examples/C++NPv2/Logging_Event_Handler_Ex.h56
-rw-r--r--examples/C++NPv2/Logging_Handler.cpp128
-rw-r--r--examples/C++NPv2/Logging_Handler.h55
-rw-r--r--examples/C++NPv2/Makefile62
-rw-r--r--examples/C++NPv2/Makefile.AC_CLD48
-rw-r--r--examples/C++NPv2/Makefile.AIO_CLD47
-rw-r--r--examples/C++NPv2/Makefile.CLD41
-rw-r--r--examples/C++NPv2/Makefile.Configurable_Logging_Server30
-rw-r--r--examples/C++NPv2/Makefile.Reactor_Logging_Server33
-rw-r--r--examples/C++NPv2/Makefile.SLD41
-rw-r--r--examples/C++NPv2/Makefile.SLDex43
-rw-r--r--examples/C++NPv2/Makefile.SR_Configurable_Logging_Server29
-rw-r--r--examples/C++NPv2/Makefile.Select_Reactor_Logging_Server34
-rw-r--r--examples/C++NPv2/Makefile.TPCLS58
-rw-r--r--examples/C++NPv2/Makefile.TPLS41
-rw-r--r--examples/C++NPv2/Makefile.TP_Reactor_Logging_Server34
-rw-r--r--examples/C++NPv2/Makefile.display_logfile32
-rw-r--r--examples/C++NPv2/README99
-rw-r--r--examples/C++NPv2/Reactor_Logging_Server.cpp34
-rw-r--r--examples/C++NPv2/Reactor_Logging_Server.dsp144
-rw-r--r--examples/C++NPv2/Reactor_Logging_Server.h29
-rw-r--r--examples/C++NPv2/Reactor_Logging_Server_Adapter.cpp67
-rw-r--r--examples/C++NPv2/Reactor_Logging_Server_Adapter.h35
-rw-r--r--examples/C++NPv2/Reactor_Logging_Server_T.cpp26
-rw-r--r--examples/C++NPv2/SLD.cpp23
-rw-r--r--examples/C++NPv2/SLD.dsp149
-rw-r--r--examples/C++NPv2/SLDEX_export.h34
-rw-r--r--examples/C++NPv2/SLD_export.h34
-rw-r--r--examples/C++NPv2/SLDex.cpp23
-rw-r--r--examples/C++NPv2/SLDex.dsp157
-rw-r--r--examples/C++NPv2/SR_Configurable_Logging_Server.cpp25
-rw-r--r--examples/C++NPv2/SR_Configurable_Logging_Server.dsp104
-rw-r--r--examples/C++NPv2/Select_Reactor_Logging_Server.cpp106
-rw-r--r--examples/C++NPv2/Select_Reactor_Logging_Server.dsp144
-rw-r--r--examples/C++NPv2/Server_Shutdown.cpp94
-rw-r--r--examples/C++NPv2/Service_Reporter.cpp124
-rw-r--r--examples/C++NPv2/Service_Reporter.h38
-rw-r--r--examples/C++NPv2/TPCLS.dsp129
-rw-r--r--examples/C++NPv2/TPCLS_export.h50
-rw-r--r--examples/C++NPv2/TPC_Logging_Server.cpp105
-rw-r--r--examples/C++NPv2/TPC_Logging_Server.h87
-rw-r--r--examples/C++NPv2/TPLS.dsp145
-rw-r--r--examples/C++NPv2/TPLS_export.h34
-rw-r--r--examples/C++NPv2/TP_Logging_Server.cpp74
-rw-r--r--examples/C++NPv2/TP_Logging_Server.h132
-rw-r--r--examples/C++NPv2/TP_Reactor_Logging_Server.cpp113
-rw-r--r--examples/C++NPv2/TP_Reactor_Logging_Server.dsp144
-rw-r--r--examples/C++NPv2/WFMO_Reactor_Logging_Server.cpp135
-rw-r--r--examples/C++NPv2/WFMO_Reactor_Logging_Server.dsp144
-rw-r--r--examples/C++NPv2/display_logfile.cpp363
-rw-r--r--examples/C++NPv2/display_logfile.dsp104
-rw-r--r--examples/C++NPv2/examples.dsw191
-rw-r--r--examples/C++NPv2/svc.conf8
70 files changed, 0 insertions, 6429 deletions
diff --git a/examples/C++NPv2/AC_CLD.dsp b/examples/C++NPv2/AC_CLD.dsp
deleted file mode 100644
index 294a3d0956d..00000000000
--- a/examples/C++NPv2/AC_CLD.dsp
+++ /dev/null
@@ -1,121 +0,0 @@
-# Microsoft Developer Studio Project File - Name="AC_CLD" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=AC_CLD - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "AC_CLD.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "AC_CLD.mak" CFG="AC_CLD - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "AC_CLD - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "AC_CLD - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "AC_CLD - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "AC_CLD___Win32_Release"
-# PROP BASE Intermediate_Dir "AC_CLD___Win32_Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "AC_CLD_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "AC_CLD_EXPORTS" /D "AC_CLD_BUILD_DLL" /FD /c
-# SUBTRACT CPP /YX
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 ace.lib libeay32.lib ssleay32.lib /nologo /dll /machine:I386 /libpath:"..\..\ace"
-
-!ELSEIF "$(CFG)" == "AC_CLD - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "AC_CLD___Win32_Debug"
-# PROP BASE Intermediate_Dir "AC_CLD___Win32_Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "AC_CLD_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\.." /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "AC_CLD_EXPORTS" /D "AC_CLD_BUILD_DLL" /FD /c
-# SUBTRACT CPP /YX
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 aced.lib libeay32.lib ssleay32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept /libpath:"..\..\ace"
-
-!ENDIF
-
-# Begin Target
-
-# Name "AC_CLD - Win32 Release"
-# Name "AC_CLD - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\AC_Client_Logging_Daemon.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\Logging_Handler.cpp
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\AC_CLD_export.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\Logging_Handler.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/examples/C++NPv2/AC_CLD_export.h b/examples/C++NPv2/AC_CLD_export.h
deleted file mode 100644
index b74dad36e8b..00000000000
--- a/examples/C++NPv2/AC_CLD_export.h
+++ /dev/null
@@ -1,50 +0,0 @@
-
-// -*- C++ -*-
-// $Id$
-// Definition for Win32 Export directives.
-// This file is generated automatically by generate_export_file.pl AC_CLD
-// ------------------------------
-#ifndef AC_CLD_EXPORT_H
-#define AC_CLD_EXPORT_H
-
-#include "ace/config-all.h"
-
-#if !defined (AC_CLD_HAS_DLL)
-# define AC_CLD_HAS_DLL 1
-#endif /* ! AC_CLD_HAS_DLL */
-
-#if defined (AC_CLD_HAS_DLL) && (AC_CLD_HAS_DLL == 1)
-# if defined (AC_CLD_BUILD_DLL)
-# define AC_CLD_Export ACE_Proper_Export_Flag
-# define AC_CLD_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
-# define AC_CLD_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
-# else /* AC_CLD_BUILD_DLL */
-# define AC_CLD_Export ACE_Proper_Import_Flag
-# define AC_CLD_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
-# define AC_CLD_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
-# endif /* AC_CLD_BUILD_DLL */
-#else /* AC_CLD_HAS_DLL == 1 */
-# define AC_CLD_Export
-# define AC_CLD_SINGLETON_DECLARATION(T)
-# define AC_CLD_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
-#endif /* AC_CLD_HAS_DLL == 1 */
-
-// Set AC_CLD_NTRACE = 0 to turn on library specific tracing even if
-// tracing is turned off for ACE.
-#if !defined (AC_CLD_NTRACE)
-# if (ACE_NTRACE == 1)
-# define AC_CLD_NTRACE 1
-# else /* (ACE_NTRACE == 1) */
-# define AC_CLD_NTRACE 0
-# endif /* (ACE_NTRACE == 1) */
-#endif /* !AC_CLD_NTRACE */
-
-#if (AC_CLD_NTRACE == 1)
-# define AC_CLD_TRACE(X)
-#else /* (AC_CLD_NTRACE == 1) */
-# define AC_CLD_TRACE(X) ACE_TRACE_IMPL(X)
-#endif /* (AC_CLD_NTRACE == 1) */
-
-#endif /* AC_CLD_EXPORT_H */
-
-// End of auto generated file.
diff --git a/examples/C++NPv2/AC_Client_Logging_Daemon.cpp b/examples/C++NPv2/AC_Client_Logging_Daemon.cpp
deleted file mode 100644
index 601fa6e0ec7..00000000000
--- a/examples/C++NPv2/AC_Client_Logging_Daemon.cpp
+++ /dev/null
@@ -1,441 +0,0 @@
-/*
-** $Id$
-**
-** Copyright 2002 Addison Wesley. All Rights Reserved.
-*/
-
-#include "ace/OS.h"
-#include "ace/Acceptor.h"
-#include "ace/Connector.h"
-#include "ace/Get_Opt.h"
-#include "ace/Handle_Set.h"
-#include "ace/INET_Addr.h"
-#include "ace/Log_Record.h"
-#include "ace/Message_Block.h"
-#include "ace/Reactor.h"
-#include "ace/Service_Object.h"
-#include "ace/Signal.h"
-#include "ace/Svc_Handler.h"
-#include "ace/Synch.h"
-#include "ace/SOCK_Acceptor.h"
-#include "ace/SOCK_Connector.h"
-#include "ace/SOCK_Stream.h"
-#include "ace/Thread_Manager.h"
-#include "Logging_Handler.h"
-#include "AC_CLD_export.h"
-#include <openssl/ssl.h>
-
-class AC_CLD_Connector;
-
-class AC_Output_Handler
- : public ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_MT_SYNCH> {
-public:
- enum { QUEUE_MAX = sizeof (ACE_Log_Record) * ACE_IOV_MAX };
-
- virtual int open (void *); // Initialization hook method.
-
- // Entry point into the <AC_Output_Handler>.
- virtual int put (ACE_Message_Block *, ACE_Time_Value * = 0);
-
-protected:
- AC_CLD_Connector *connector_;
-
- // Handle disconnects from the logging server.
- virtual int handle_input (ACE_HANDLE handle);
-
- // Hook method forwards log records to server logging daemon.
- virtual int svc ();
-
- // Send the buffered log records using a gather-write operation.
- virtual int send (ACE_Message_Block *chunk[], size_t &count);
-};
-
-class AC_Input_Handler
- : public ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_NULL_SYNCH> {
-public:
- AC_Input_Handler (AC_Output_Handler *handler = 0)
- : output_handler_ (handler) {}
- virtual int open (void *); // Initialization hook method.
- virtual int close (u_int = 0); // Shutdown hook method.
-
-protected:
- // Reactor hook methods.
- virtual int handle_input (ACE_HANDLE handle);
- virtual int handle_close (ACE_HANDLE = ACE_INVALID_HANDLE,
- ACE_Reactor_Mask = 0);
-
- // Pointer to the output handler.
- AC_Output_Handler *output_handler_;
-
- // Keep track of connected client handles.
- ACE_Handle_Set connected_clients_;
-};
-
-class AC_CLD_Acceptor
- : public ACE_Acceptor<AC_Input_Handler, ACE_SOCK_ACCEPTOR> {
-public:
- // Constructor.
- AC_CLD_Acceptor (AC_Output_Handler *handler = 0)
- : output_handler_ (handler), input_handler_ (handler) {}
-
-protected:
- typedef ACE_Acceptor<AC_Input_Handler, ACE_SOCK_ACCEPTOR>
- PARENT;
-
- // <ACE_Acceptor> factory method.
- virtual int make_svc_handler (AC_Input_Handler *&sh);
-
- // <ACE_Reactor> close hook method.
- virtual int handle_close (ACE_HANDLE = ACE_INVALID_HANDLE,
- ACE_Reactor_Mask = 0);
-
- // Pointer to the output handler.
- AC_Output_Handler *output_handler_;
-
- // Single input handler.
- AC_Input_Handler input_handler_;
-};
-
-class AC_CLD_Connector
- : public ACE_Connector<AC_Output_Handler, ACE_SOCK_CONNECTOR> {
-public:
- typedef ACE_Connector<AC_Output_Handler, ACE_SOCK_CONNECTOR>
- PARENT;
-
- // Constructor.
- AC_CLD_Connector (AC_Output_Handler *handler = 0)
- : handler_ (handler), ssl_ctx_ (0), ssl_ (0) {}
-
- // Destructor frees the SSL resources.
- virtual ~AC_CLD_Connector (void) {
- SSL_free (ssl_);
- SSL_CTX_free (ssl_ctx_);
- }
-
- // Initialize the Connector.
- virtual int open (ACE_Reactor *r = ACE_Reactor::instance (),
- int flags = 0);
-
- // Re-establish a connection to the logging server.
- int reconnect ();
-
-protected:
- // Connection establishment and authentication hook method.
- virtual int connect_svc_handler
- (AC_Output_Handler *svc_handler,
- const ACE_SOCK_Connector::PEER_ADDR &remote_addr,
- ACE_Time_Value *timeout,
- const ACE_SOCK_Connector::PEER_ADDR &local_addr,
- int reuse_addr, int flags, int perms);
-
- // Pointer to <AC_Output_Handler> we're connecting.
- AC_Output_Handler *handler_;
-
- // Address at which logging server listens for connections.
- ACE_INET_Addr remote_addr_;
-
- // The SSL "context" data structure.
- SSL_CTX *ssl_ctx_;
-
- // The SSL data structure corresponding to authenticated SSL
- // connections.
- SSL *ssl_;
-};
-
-class AC_Client_Logging_Daemon : public ACE_Service_Object {
-protected:
- // Factory that passively connects the <AC_Input_Handler>.
- AC_CLD_Acceptor acceptor_;
-
- // Factory that actively connects the <AC_Output_Handler>.
- AC_CLD_Connector connector_;
-
- // The <AC_Output_Handler> connected by <AC_CLD_Connector>.
- AC_Output_Handler output_handler_;
-
-public:
- // Constructor.
- AC_Client_Logging_Daemon ()
- : acceptor_ (&output_handler_),
- connector_ (&output_handler_) {}
-
- // Service Configurator hook methods.
- virtual int init (int argc, ACE_TCHAR *argv[]);
- virtual int fini ();
- //virtual int info (ACE_TCHAR **bufferp, size_t length = 0) const;
- //virtual int suspend ();
- //virtual int resume ();
-};
-
-/******************************************************/
-
-#if !defined (FLUSH_TIMEOUT)
-#define FLUSH_TIMEOUT 120 /* 120 seconds == 2 minutes. */
-#endif /* FLUSH_TIMEOUT */
-
-int AC_Output_Handler::open (void *connector) {
- connector_ =
- ACE_static_cast (AC_CLD_Connector *, connector);
- int bufsiz = ACE_DEFAULT_MAX_SOCKET_BUFSIZ;
- peer ().set_option (SOL_SOCKET, SO_SNDBUF,
- &bufsiz, sizeof bufsiz);
- if (reactor ()->register_handler
- (this, ACE_Event_Handler::READ_MASK) == -1)
- return -1;
- if (msg_queue ()->activate ()
- == ACE_Message_Queue_Base::ACTIVATED) {
- msg_queue ()->high_water_mark (QUEUE_MAX);
- return activate (THR_SCOPE_SYSTEM);
- } else return 0;
-}
-
-int AC_Output_Handler::put (ACE_Message_Block *mb,
- ACE_Time_Value *timeout) {
- int retval;
- while ((retval = putq (mb, timeout)) == -1) {
- if (msg_queue ()->state () != ACE_Message_Queue_Base::PULSED)
- break;
- }
- return retval;
-}
-
-int AC_Output_Handler::handle_input (ACE_HANDLE h) {
- peer ().close ();
- reactor ()->remove_handler
- (h, ACE_Event_Handler::READ_MASK
- | ACE_Event_Handler::DONT_CALL);
- msg_queue ()->pulse ();
- return 0;
-}
-
-int AC_Output_Handler::svc () {
- ACE_Message_Block *chunk[ACE_IOV_MAX];
- size_t message_index = 0;
- ACE_Time_Value time_of_last_send (ACE_OS::gettimeofday ());
- ACE_Time_Value timeout;
- ACE_Sig_Action no_sigpipe ((ACE_SignalHandler) SIG_IGN);
- ACE_Sig_Action original_action;
- no_sigpipe.register_action (SIGPIPE, &original_action);
-
- for (;;) {
- if (message_index == 0) {
- timeout = ACE_OS::gettimeofday ();
- timeout += FLUSH_TIMEOUT;
- }
- ACE_Message_Block *mblk = 0;
- if (getq (mblk, &timeout) == -1) {
- if (errno == ESHUTDOWN) {
- if (connector_->reconnect () == -1) break;
- continue;
- } else if (errno != EWOULDBLOCK) break;
- else if (message_index == 0) continue;
- } else {
- if (mblk->size () == 0
- && mblk->msg_type () == ACE_Message_Block::MB_STOP)
- { mblk->release (); break; }
- chunk[message_index] = mblk;
- ++message_index;
- }
- if (message_index >= ACE_IOV_MAX ||
- (ACE_OS::gettimeofday () - time_of_last_send
- >= FLUSH_TIMEOUT)) {
- if (send (chunk, message_index) == -1) break;
- time_of_last_send = ACE_OS::gettimeofday ();
- }
- }
-
- if (message_index > 0) send (chunk, message_index);
- no_sigpipe.restore_action (SIGPIPE, original_action);
- return 0;
-}
-
-int AC_Output_Handler::send (ACE_Message_Block *chunk[], size_t &count) {
- iovec iov[ACE_IOV_MAX];
- size_t iov_size;
- int result = 0;
-
- for (iov_size = 0; iov_size < count; ++iov_size) {
- iov[iov_size].iov_base = chunk[iov_size]->rd_ptr ();
- iov[iov_size].iov_len = chunk[iov_size]->length ();
- }
- while (peer ().sendv_n (iov, iov_size) == -1)
- if (connector_->reconnect () == -1) {
- result = -1;
- break;
- }
-
- while (iov_size > 0) {
- chunk[--iov_size]->release (); chunk[iov_size] = 0;
- }
- count = iov_size;
- return result;
-}
-
-/******************************************************/
-
-int AC_Input_Handler::open (void *) {
- ACE_HANDLE handle = peer ().get_handle ();
- if (reactor ()->register_handler
- (handle, this, ACE_Event_Handler::READ_MASK) == -1)
- return -1;
- connected_clients_.set_bit (handle);
- return 0;
-}
-
-int AC_Input_Handler::close (u_int) {
- ACE_Message_Block *shutdown_message = 0;
- ACE_NEW_RETURN
- (shutdown_message,
- ACE_Message_Block (0, ACE_Message_Block::MB_STOP), -1);
- output_handler_->put (shutdown_message);
-
- reactor ()->remove_handler
- (connected_clients_, ACE_Event_Handler::READ_MASK);
- return output_handler_->wait ();
-}
-
-int AC_Input_Handler::handle_input (ACE_HANDLE handle) {
- ACE_Message_Block *mblk = 0;
- Logging_Handler logging_handler (handle);
-
- if (logging_handler.recv_log_record (mblk) != -1)
- if (output_handler_->put (mblk->cont ()) != -1) {
- mblk->cont (0);
- mblk->release ();
- return 0; // Success return.
- } else mblk->release ();
- return -1; // Error return.
-}
-
-int AC_Input_Handler::handle_close (ACE_HANDLE handle,
- ACE_Reactor_Mask) {
- connected_clients_.clr_bit (handle);
- return ACE_OS::closesocket (handle);
-}
-
-/********************************************************/
-
-int AC_CLD_Acceptor::make_svc_handler (AC_Input_Handler *&sh)
-{ sh = &input_handler_; return 0; }
-
-
-int AC_CLD_Acceptor::handle_close (ACE_HANDLE,
- ACE_Reactor_Mask) {
- PARENT::handle_close ();
- input_handler_.close ();
- return 0;
-}
-
-/*******************************************************/
-
-#if !defined (CLD_CERTIFICATE_FILENAME)
-# define CLD_CERTIFICATE_FILENAME "cld-cert.pem"
-#endif /* !CLD_CERTIFICATE_FILENAME */
-#if !defined (CLD_KEY_FILENAME)
-# define CLD_KEY_FILENAME "cld-key.pem"
-#endif /* !CLD_KEY_FILENAME */
-
-int AC_CLD_Connector::open (ACE_Reactor *r, int flags) {
- if (PARENT::open (r, flags) != 0) return -1;
- OpenSSL_add_ssl_algorithms ();
- ssl_ctx_ = SSL_CTX_new (SSLv3_client_method ());
- if (ssl_ctx_ == 0) return -1;
-
- if (SSL_CTX_use_certificate_file (ssl_ctx_,
- CLD_CERTIFICATE_FILENAME,
- SSL_FILETYPE_PEM) <= 0
- || SSL_CTX_use_PrivateKey_file (ssl_ctx_,
- CLD_KEY_FILENAME,
- SSL_FILETYPE_PEM) <= 0
- || !SSL_CTX_check_private_key (ssl_ctx_))
- return -1;
-
- ssl_ = SSL_new (ssl_ctx_);
- if (ssl_ == 0) return -1;
- return 0;
-}
-
-int AC_CLD_Connector::connect_svc_handler
- (AC_Output_Handler *svc_handler,
- const ACE_SOCK_Connector::PEER_ADDR &remote_addr,
- ACE_Time_Value *timeout,
- const ACE_SOCK_Connector::PEER_ADDR &local_addr,
- int reuse_addr, int flags, int perms) {
- if (PARENT::connect_svc_handler
- (svc_handler, remote_addr, timeout,
- local_addr, reuse_addr, flags, perms) == -1) return -1;
- SSL_clear (ssl_);
- SSL_set_fd (ssl_,
- ACE_reinterpret_cast (int, svc_handler->get_handle ()));
-
- SSL_set_verify (ssl_, SSL_VERIFY_PEER, 0);
-
- if (SSL_connect (ssl_) == -1
- || SSL_shutdown (ssl_) == -1) return -1;
- remote_addr_ = remote_addr;
- return 0;
-}
-
-int AC_CLD_Connector::reconnect () {
- // Maximum number of times to retry connect.
- const size_t MAX_RETRIES = 5;
- ACE_Time_Value timeout (1);
- size_t i;
- for (i = 0; i < MAX_RETRIES; ++i) {
- ACE_Synch_Options options (ACE_Synch_Options::USE_TIMEOUT,
- timeout);
- if (i > 0) ACE_OS::sleep (timeout);
- if (connect (handler_, remote_addr_, options) == 0)
- break;
- timeout *= 2; // Exponential backoff.
- }
- return i == MAX_RETRIES ? -1 : 0;
-}
-
-/******************************************************/
-
-int AC_Client_Logging_Daemon::init
- (int argc, ACE_TCHAR *argv[]) {
- u_short cld_port = ACE_DEFAULT_SERVICE_PORT;
- u_short sld_port = ACE_DEFAULT_LOGGING_SERVER_PORT;
- ACE_TCHAR sld_host[MAXHOSTNAMELEN];
- ACE_OS_String::strcpy (sld_host, ACE_LOCALHOST);
-
- ACE_Get_Opt get_opt (argc, argv, ACE_TEXT ("p:r:s:"), 0);
- get_opt.long_option (ACE_TEXT ("client_port"), 'p',
- ACE_Get_Opt::ARG_REQUIRED);
- get_opt.long_option (ACE_TEXT ("server_port"), 'r',
- ACE_Get_Opt::ARG_REQUIRED);
- get_opt.long_option (ACE_TEXT ("server_name"), 's',
- ACE_Get_Opt::ARG_REQUIRED);
-
- for (int c; (c = get_opt ()) != -1;)
- switch (c) {
- case 'p': // Client logging daemon acceptor port number.
- cld_port = ACE_static_cast
- (u_short, ACE_OS::atoi (get_opt.opt_arg ()));
- break;
- case 'r': // Server logging daemon acceptor port number.
- sld_port = ACE_static_cast
- (u_short, ACE_OS::atoi (get_opt.opt_arg ()));
- break;
- case 's': // Server logging daemon hostname.
- ACE_OS_String::strsncpy
- (sld_host, get_opt.opt_arg (), MAXHOSTNAMELEN);
- break;
- }
-
- ACE_INET_Addr cld_addr (cld_port);
- ACE_INET_Addr sld_addr (sld_port, sld_host);
-
- if (acceptor_.open (cld_addr) == -1) return -1;
- AC_Output_Handler *oh = &output_handler_;
- if (connector_.connect (oh, sld_addr) == -1)
- { acceptor_.close (); return -1; }
- return 0;
-}
-
-int AC_Client_Logging_Daemon::fini ()
-{ return acceptor_.close (); }
-
-ACE_FACTORY_DEFINE (AC_CLD, AC_Client_Logging_Daemon)
diff --git a/examples/C++NPv2/AIO_CLD.dsp b/examples/C++NPv2/AIO_CLD.dsp
deleted file mode 100644
index e526ec574cf..00000000000
--- a/examples/C++NPv2/AIO_CLD.dsp
+++ /dev/null
@@ -1,113 +0,0 @@
-# Microsoft Developer Studio Project File - Name="AIO_CLD" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=AIO_CLD - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "AIO_CLD.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "AIO_CLD.mak" CFG="AIO_CLD - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "AIO_CLD - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "AIO_CLD - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "AIO_CLD - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "AIO_CLD___Win32_Release"
-# PROP BASE Intermediate_Dir "AIO_CLD___Win32_Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "AIO_CLD_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "AIO_CLD_EXPORTS" /D "AIO_CLD_BUILD_DLL" /FD /c
-# SUBTRACT CPP /YX
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 ace.lib libeay32.lib ssleay32.lib /nologo /dll /machine:I386 /libpath:"..\..\ace"
-
-!ELSEIF "$(CFG)" == "AIO_CLD - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "AIO_CLD___Win32_Debug"
-# PROP BASE Intermediate_Dir "AIO_CLD___Win32_Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "AIO_CLD_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\.." /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "AIO_CLD_EXPORTS" /D "AIO_CLD_BUILD_DLL" /FD /c
-# SUBTRACT CPP /YX
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 aced.lib libeay32.lib ssleay32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept /libpath:"..\..\ace"
-
-!ENDIF
-
-# Begin Target
-
-# Name "AIO_CLD - Win32 Release"
-# Name "AIO_CLD - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\AIO_Client_Logging_Daemon.cpp
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\AIO_CLD_export.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/examples/C++NPv2/AIO_CLD_export.h b/examples/C++NPv2/AIO_CLD_export.h
deleted file mode 100644
index 0f93d0a07b5..00000000000
--- a/examples/C++NPv2/AIO_CLD_export.h
+++ /dev/null
@@ -1,50 +0,0 @@
-
-// -*- C++ -*-
-// $Id$
-// Definition for Win32 Export directives.
-// This file is generated automatically by generate_export_file.pl AIO_CLD
-// ------------------------------
-#ifndef AIO_CLD_EXPORT_H
-#define AIO_CLD_EXPORT_H
-
-#include "ace/config-all.h"
-
-#if !defined (AIO_CLD_HAS_DLL)
-# define AIO_CLD_HAS_DLL 1
-#endif /* ! AIO_CLD_HAS_DLL */
-
-#if defined (AIO_CLD_HAS_DLL) && (AIO_CLD_HAS_DLL == 1)
-# if defined (AIO_CLD_BUILD_DLL)
-# define AIO_CLD_Export ACE_Proper_Export_Flag
-# define AIO_CLD_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
-# define AIO_CLD_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
-# else /* AIO_CLD_BUILD_DLL */
-# define AIO_CLD_Export ACE_Proper_Import_Flag
-# define AIO_CLD_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
-# define AIO_CLD_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
-# endif /* AIO_CLD_BUILD_DLL */
-#else /* AIO_CLD_HAS_DLL == 1 */
-# define AIO_CLD_Export
-# define AIO_CLD_SINGLETON_DECLARATION(T)
-# define AIO_CLD_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
-#endif /* AIO_CLD_HAS_DLL == 1 */
-
-// Set AIO_CLD_NTRACE = 0 to turn on library specific tracing even if
-// tracing is turned off for ACE.
-#if !defined (AIO_CLD_NTRACE)
-# if (ACE_NTRACE == 1)
-# define AIO_CLD_NTRACE 1
-# else /* (ACE_NTRACE == 1) */
-# define AIO_CLD_NTRACE 0
-# endif /* (ACE_NTRACE == 1) */
-#endif /* !AIO_CLD_NTRACE */
-
-#if (AIO_CLD_NTRACE == 1)
-# define AIO_CLD_TRACE(X)
-#else /* (AIO_CLD_NTRACE == 1) */
-# define AIO_CLD_TRACE(X) ACE_TRACE_IMPL(X)
-#endif /* (AIO_CLD_NTRACE == 1) */
-
-#endif /* AIO_CLD_EXPORT_H */
-
-// End of auto generated file.
diff --git a/examples/C++NPv2/AIO_Client_Logging_Daemon.cpp b/examples/C++NPv2/AIO_Client_Logging_Daemon.cpp
deleted file mode 100644
index 923ea7bfe67..00000000000
--- a/examples/C++NPv2/AIO_Client_Logging_Daemon.cpp
+++ /dev/null
@@ -1,437 +0,0 @@
-/*
-** $Id$
-**
-** Copyright 2002 Addison Wesley. All Rights Reserved.
-*/
-
-#include "ace/OS.h"
-#include "ace/Asynch_Acceptor.h"
-#include "ace/Asynch_Connector.h"
-#include "ace/Asynch_IO.h"
-#include "ace/CDR_Stream.h"
-#include "ace/Get_Opt.h"
-#include "ace/INET_Addr.h"
-#include "ace/Message_Block.h"
-#include "ace/Proactor.h"
-#include "ace/SOCK_Stream.h"
-#include "ace/Service_Object.h"
-#include "ace/Signal.h"
-#include "ace/Singleton.h"
-#include "ace/Synch.h"
-#include "ace/Task.h"
-#include "ace/Thread_Manager.h"
-#include "ace/Unbounded_Set.h"
-#include "AIO_CLD_export.h"
-#include <openssl/ssl.h>
-
-
-class AIO_Output_Handler
- : public ACE_Task<ACE_NULL_SYNCH>,
- public ACE_Service_Handler {
-public:
- AIO_Output_Handler () : can_write_ (0) {}
-
- virtual ~AIO_Output_Handler ();
-
- // Entry point into the <AIO_Output_Handler>.
- virtual int put (ACE_Message_Block *, ACE_Time_Value * = 0);
-
- // Hook method called when server connection is established.
- virtual void open (ACE_HANDLE new_handle,
- ACE_Message_Block &message_block);
-
-protected:
- ACE_Asynch_Read_Stream reader_; // Detects connection loss
- ACE_Asynch_Write_Stream writer_; // Sends to server
- int can_write_; // Safe to begin send a log record?
-
- // Initiate the send of a log record
- void start_write (ACE_Message_Block *mblk = 0);
-
- // Handle disconnects from the logging server.
- virtual void handle_read_stream
- (const ACE_Asynch_Read_Stream::Result &result);
-
- // Handle completed write to logging server.
- virtual void handle_write_stream
- (const ACE_Asynch_Write_Stream::Result &result);
-};
-
-typedef ACE_Unmanaged_Singleton<AIO_Output_Handler, ACE_Null_Mutex>
- OUTPUT_HANDLER;
-
-
-class AIO_CLD_Acceptor;
-
-class AIO_Input_Handler : public ACE_Service_Handler {
-public:
- AIO_Input_Handler (AIO_CLD_Acceptor *acc = 0)
- : acceptor_ (acc), mblk_ (0) {}
-
- virtual ~AIO_Input_Handler ();
-
- // Called by ACE_Asynch_Acceptor when a client connects.
- virtual void open (ACE_HANDLE new_handle,
- ACE_Message_Block &message_block);
-
-protected:
- enum { LOG_HEADER_SIZE = 8 }; // Length of CDR header
- AIO_CLD_Acceptor *acceptor_; // Our creator
- ACE_Message_Block *mblk_; // Block to receive log record
- ACE_Asynch_Read_Stream reader_; // Async read factory
-
- // Handle input from logging clients.
- virtual void handle_read_stream
- (const ACE_Asynch_Read_Stream::Result &result);
-};
-
-
-class AIO_CLD_Acceptor
- : public ACE_Asynch_Acceptor<AIO_Input_Handler> {
-public:
- // Cancel accept and close all clients.
- void close (void);
-
- // Remove handler from client set.
- void remove (AIO_Input_Handler *ih)
- { clients_.remove (ih); }
-
-protected:
- // Service handler factory method.
- virtual AIO_Input_Handler *make_handler (void);
-
- // Set of all connected clients
- ACE_Unbounded_Set<AIO_Input_Handler *> clients_;
-};
-
-
-class AIO_CLD_Connector
- : public ACE_Asynch_Connector<AIO_Output_Handler> {
-public:
- enum { INITIAL_RETRY_DELAY = 3, MAX_RETRY_DELAY = 60 };
-
- // Constructor.
- AIO_CLD_Connector ()
- : retry_delay_ (INITIAL_RETRY_DELAY), ssl_ctx_ (0), ssl_ (0)
- { open (); }
-
- // Destructor frees the SSL resources.
- virtual ~AIO_CLD_Connector (void) {
- SSL_free (ssl_);
- SSL_CTX_free (ssl_ctx_);
- proactor ()->cancel_timer (*this);
- }
-
- // Hook method to detect failure and validate peer before
- // opening handler.
- virtual int validate_connection
- (const ACE_Asynch_Connect::Result& result,
- const ACE_INET_Addr &remote, const ACE_INET_Addr& local);
-
- // Re-establish a connection to the logging server.
- int reconnect (void) { return connect (remote_addr_); }
-
-protected:
- // Hook method called on timer expiration - retry connect
- virtual void handle_time_out
- (const ACE_Time_Value&, const void *);
-
- // Template method to create a new handler
- virtual AIO_Output_Handler *make_handler (void)
- { return OUTPUT_HANDLER::instance (); }
-
- // Address at which logging server listens for connections.
- ACE_INET_Addr remote_addr_;
-
- // Seconds to wait before trying the next connect
- int retry_delay_;
-
- // The SSL "context" data structure.
- SSL_CTX *ssl_ctx_;
-
- // The SSL data structure corresponding to authenticated SSL
- // connections.
- SSL *ssl_;
-};
-
-typedef ACE_Unmanaged_Singleton<AIO_CLD_Connector, ACE_Null_Mutex>
- CLD_CONNECTOR;
-
-
-class AIO_Client_Logging_Daemon : public ACE_Task<ACE_NULL_SYNCH> {
-protected:
- ACE_INET_Addr cld_addr_;
- ACE_INET_Addr sld_addr_;
-
- // Factory that passively connects the <AIO_Input_Handler>.
- AIO_CLD_Acceptor acceptor_;
-
-public:
- // Service Configurator hook methods.
- virtual int init (int argc, ACE_TCHAR *argv[]);
- virtual int fini ();
- virtual int svc (void);
-};
-
-/******************************************************/
-
-AIO_Output_Handler::~AIO_Output_Handler () {
- reader_.cancel ();
- writer_.cancel ();
- ACE_OS::closesocket (handle ());
-}
-
-int AIO_Output_Handler::put (ACE_Message_Block *mb,
- ACE_Time_Value *timeout) {
- if (can_write_) { start_write (mb); return 0; }
- return putq (mb, timeout);
-}
-
-void AIO_Output_Handler::open
- (ACE_HANDLE new_handle, ACE_Message_Block &) {
- ACE_SOCK_Stream peer (new_handle);
- int bufsiz = ACE_DEFAULT_MAX_SOCKET_BUFSIZ;
- peer.set_option (SOL_SOCKET, SO_SNDBUF,
- &bufsiz, sizeof bufsiz);
-
- reader_.open (*this, new_handle, 0, proactor ());
- writer_.open (*this, new_handle, 0, proactor ());
-
- ACE_Message_Block *mb;
- ACE_NEW (mb, ACE_Message_Block (1));
- reader_.read (*mb, 1);
- ACE_Sig_Action no_sigpipe ((ACE_SignalHandler) SIG_IGN);
- no_sigpipe.register_action (SIGPIPE, 0);
- can_write_ = 1;
- start_write (0);
-}
-
-void AIO_Output_Handler::start_write (ACE_Message_Block *mblk) {
- if (mblk == 0) {
- ACE_Time_Value nonblock (0);
- getq (mblk, &nonblock);
- }
- if (mblk != 0) {
- can_write_ = 0;
- if (writer_.write (*mblk, mblk->length ()) == -1)
- ungetq (mblk);
- }
-}
-
-void AIO_Output_Handler::handle_read_stream
- (const ACE_Asynch_Read_Stream::Result &result) {
- result.message_block ().release ();
- writer_.cancel ();
- ACE_OS::closesocket (result.handle ());
- handle (ACE_INVALID_HANDLE);
- can_write_ = 0;
- CLD_CONNECTOR::instance ()->reconnect ();
-}
-
-void AIO_Output_Handler::handle_write_stream
- (const ACE_Asynch_Write_Stream::Result &result) {
- ACE_Message_Block &mblk = result.message_block ();
- if (!result.success ()) {
- mblk.rd_ptr (mblk.base ());
- ungetq (&mblk);
- }
- else {
- can_write_ = handle () == result.handle ();
- if (mblk.length () == 0) {
- mblk.release ();
- if (can_write_) start_write ();
- }
- else if (can_write_) start_write (&mblk);
- else { mblk.rd_ptr (mblk.base ()); ungetq (&mblk); }
- }
-}
-
-/******************************************************/
-
-AIO_Input_Handler::~AIO_Input_Handler () {
- reader_.cancel ();
- ACE_OS::closesocket (handle ());
- if (mblk_ != 0) mblk_->release ();
- mblk_ = 0;
- acceptor_->remove (this);
-}
-
-void AIO_Input_Handler::open
- (ACE_HANDLE new_handle, ACE_Message_Block &) {
- reader_.open (*this, new_handle, 0, proactor ());
- ACE_NEW_NORETURN
- (mblk_, ACE_Message_Block (ACE_DEFAULT_CDR_BUFSIZE));
- // Align the Message Block for a CDR stream
- ACE_CDR::mb_align (mblk_);
- reader_.read (*mblk_, LOG_HEADER_SIZE);
-}
-
-void AIO_Input_Handler::handle_read_stream
- (const ACE_Asynch_Read_Stream::Result &result) {
- if (!result.success () || result.bytes_transferred () == 0)
- delete this;
- else if (result.bytes_transferred () < result.bytes_to_read ())
- reader_.read (*mblk_, result.bytes_to_read () -
- result.bytes_transferred ());
- else if (mblk_->length () == LOG_HEADER_SIZE) {
- ACE_InputCDR cdr (mblk_);
-
- ACE_CDR::Boolean byte_order;
- cdr >> ACE_InputCDR::to_boolean (byte_order);
- cdr.reset_byte_order (byte_order);
-
- ACE_CDR::ULong length;
- cdr >> length;
-
- mblk_->size (length + LOG_HEADER_SIZE);
- reader_.read (*mblk_, length);
- }
- else {
- if (OUTPUT_HANDLER::instance ()->put (mblk_) == -1)
- mblk_->release ();
-
- ACE_NEW_NORETURN
- (mblk_, ACE_Message_Block (ACE_DEFAULT_CDR_BUFSIZE));
- ACE_CDR::mb_align (mblk_);
- reader_.read (*mblk_, LOG_HEADER_SIZE);
- }
-}
-
-/********************************************************/
-
-void AIO_CLD_Acceptor::close (void) {
- ACE_Unbounded_Set_Iterator<AIO_Input_Handler *>
- iter (clients_.begin ());
- AIO_Input_Handler **ih;
- while (iter.next (ih))
- delete *ih;
-}
-
-AIO_Input_Handler * AIO_CLD_Acceptor::make_handler (void) {
- AIO_Input_Handler *ih;
- ACE_NEW_RETURN (ih, AIO_Input_Handler (this), 0);
- if (clients_.insert (ih) == -1)
- { delete ih; return 0; }
- return ih;
-}
-
-/*******************************************************/
-
-#if !defined (CLD_CERTIFICATE_FILENAME)
-# define CLD_CERTIFICATE_FILENAME "cld-cert.pem"
-#endif /* !CLD_CERTIFICATE_FILENAME */
-#if !defined (CLD_KEY_FILENAME)
-# define CLD_KEY_FILENAME "cld-key.pem"
-#endif /* !CLD_KEY_FILENAME */
-
-
-int AIO_CLD_Connector::validate_connection
- (const ACE_Asynch_Connect::Result& result,
- const ACE_INET_Addr &remote, const ACE_INET_Addr&) {
-
- remote_addr_ = remote;
- if (!result.success ()) {
- ACE_Time_Value delay (retry_delay_);
- retry_delay_ *= 2;
- if (retry_delay_ > MAX_RETRY_DELAY)
- retry_delay_ = MAX_RETRY_DELAY;
- proactor ()->schedule_timer (*this, 0, delay);
- return -1;
- }
- retry_delay_ = INITIAL_RETRY_DELAY;
-
- if (ssl_ctx_ == 0) {
- OpenSSL_add_ssl_algorithms ();
- ssl_ctx_ = SSL_CTX_new (SSLv3_client_method ());
- if (ssl_ctx_ == 0) return -1;
-
- if (SSL_CTX_use_certificate_file (ssl_ctx_,
- CLD_CERTIFICATE_FILENAME,
- SSL_FILETYPE_PEM) <= 0
- || SSL_CTX_use_PrivateKey_file (ssl_ctx_,
- CLD_KEY_FILENAME,
- SSL_FILETYPE_PEM) <= 0
- || !SSL_CTX_check_private_key (ssl_ctx_)) {
- SSL_CTX_free (ssl_ctx_);
- ssl_ctx_ = 0;
- return -1;
- }
- ssl_ = SSL_new (ssl_ctx_);
- if (ssl_ == 0) {
- SSL_CTX_free (ssl_ctx_); ssl_ctx_ = 0;
- return -1;
- }
- }
-
- SSL_clear (ssl_);
- SSL_set_fd
- (ssl_, ACE_reinterpret_cast (int, result.connect_handle ()));
-
- SSL_set_verify (ssl_, SSL_VERIFY_PEER, 0);
-
- if (SSL_connect (ssl_) == -1
- || SSL_shutdown (ssl_) == -1) return -1;
- return 0;
-}
-
-void AIO_CLD_Connector::handle_time_out
-(const ACE_Time_Value&, const void *) {
- connect (remote_addr_);
-}
-
-/******************************************************/
-
-int AIO_Client_Logging_Daemon::init
- (int argc, ACE_TCHAR *argv[]) {
- u_short cld_port = ACE_DEFAULT_SERVICE_PORT;
- u_short sld_port = ACE_DEFAULT_LOGGING_SERVER_PORT;
- ACE_TCHAR sld_host[MAXHOSTNAMELEN];
- ACE_OS_String::strcpy (sld_host, ACE_LOCALHOST);
-
- ACE_Get_Opt get_opt (argc, argv, ACE_TEXT ("p:r:s:"), 0);
- get_opt.long_option (ACE_TEXT ("client_port"), 'p',
- ACE_Get_Opt::ARG_REQUIRED);
- get_opt.long_option (ACE_TEXT ("server_port"), 'r',
- ACE_Get_Opt::ARG_REQUIRED);
- get_opt.long_option (ACE_TEXT ("server_name"), 's',
- ACE_Get_Opt::ARG_REQUIRED);
-
- for (int c; (c = get_opt ()) != -1;)
- switch (c) {
- case 'p': // Client logging daemon acceptor port number.
- cld_port = ACE_static_cast
- (u_short, ACE_OS::atoi (get_opt.opt_arg ()));
- break;
- case 'r': // Server logging daemon acceptor port number.
- sld_port = ACE_static_cast
- (u_short, ACE_OS::atoi (get_opt.opt_arg ()));
- break;
- case 's': // Server logging daemon hostname.
- ACE_OS_String::strsncpy
- (sld_host, get_opt.opt_arg (), MAXHOSTNAMELEN);
- break;
- }
-
- if (cld_addr_.set (cld_port) == -1 ||
- sld_addr_.set (sld_port, sld_host) == -1)
- return -1;
- return activate ();
-}
-
-int AIO_Client_Logging_Daemon::fini () {
- ACE_Proactor::instance ()->proactor_end_event_loop ();
- wait ();
- return 0;
-}
-
-int AIO_Client_Logging_Daemon::svc (void) {
- if (acceptor_.open (cld_addr_) == -1) return -1;
- if (CLD_CONNECTOR::instance ()->connect (sld_addr_) == 0)
- ACE_Proactor::instance ()->proactor_run_event_loop ();
- acceptor_.close ();
- CLD_CONNECTOR::close ();
- OUTPUT_HANDLER::close ();
- return 0;
-}
-
-ACE_FACTORY_DEFINE (AIO_CLD, AIO_Client_Logging_Daemon)
diff --git a/examples/C++NPv2/CLD.dsp b/examples/C++NPv2/CLD.dsp
deleted file mode 100644
index 926278a956a..00000000000
--- a/examples/C++NPv2/CLD.dsp
+++ /dev/null
@@ -1,137 +0,0 @@
-# Microsoft Developer Studio Project File - Name="CLD" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=CLD - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "CLD.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "CLD.mak" CFG="CLD - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "CLD - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "CLD - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "CLD - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "CLD___Win32_Release"
-# PROP BASE Intermediate_Dir "CLD___Win32_Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CLD_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CLD_EXPORTS" /D "CLD_BUILD_DLL" /FD /c
-# SUBTRACT CPP /YX
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 ace.lib libeay32.lib ssleay32.lib /nologo /dll /machine:I386 /libpath:"..\..\ace"
-
-!ELSEIF "$(CFG)" == "CLD - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "CLD___Win32_Debug"
-# PROP BASE Intermediate_Dir "CLD___Win32_Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CLD_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\.." /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CLD_EXPORTS" /D "CLD_BUILD_DLL" /FD /c
-# SUBTRACT CPP /YX
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 aced.lib libeay32.lib ssleay32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept /libpath:"..\..\ace"
-
-!ENDIF
-
-# Begin Target
-
-# Name "CLD - Win32 Release"
-# Name "CLD - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\Client_Logging_Daemon.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\Logging_Acceptor.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\Logging_Event_Handler.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\Logging_Handler.cpp
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\CLD_export.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\Logging_Acceptor.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\Logging_Event_Handler.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\Logging_Handler.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/examples/C++NPv2/CLD_export.h b/examples/C++NPv2/CLD_export.h
deleted file mode 100644
index 808cd6cc938..00000000000
--- a/examples/C++NPv2/CLD_export.h
+++ /dev/null
@@ -1,34 +0,0 @@
-
-// -*- C++ -*-
-// $Id$
-// Definition for Win32 Export directives.
-// This file is generated automatically by generate_export_file.pl CLD
-// ------------------------------
-#ifndef CLD_EXPORT_H
-#define CLD_EXPORT_H
-
-#include "ace/config-all.h"
-
-#if !defined (CLD_HAS_DLL)
-# define CLD_HAS_DLL 1
-#endif /* ! CLD_HAS_DLL */
-
-#if defined (CLD_HAS_DLL) && (CLD_HAS_DLL == 1)
-# if defined (CLD_BUILD_DLL)
-# define CLD_Export ACE_Proper_Export_Flag
-# define CLD_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
-# define CLD_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
-# else /* CLD_BUILD_DLL */
-# define CLD_Export ACE_Proper_Import_Flag
-# define CLD_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
-# define CLD_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
-# endif /* CLD_BUILD_DLL */
-#else /* CLD_HAS_DLL == 1 */
-# define CLD_Export
-# define CLD_SINGLETON_DECLARATION(T)
-# define CLD_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
-#endif /* CLD_HAS_DLL == 1 */
-
-#endif /* CLD_EXPORT_H */
-
-// End of auto generated file.
diff --git a/examples/C++NPv2/Client_Logging_Daemon.cpp b/examples/C++NPv2/Client_Logging_Daemon.cpp
deleted file mode 100644
index 696c0b1bc6c..00000000000
--- a/examples/C++NPv2/Client_Logging_Daemon.cpp
+++ /dev/null
@@ -1,379 +0,0 @@
-/*
-** $Id$
-**
-** Copyright 2002 Addison Wesley. All Rights Reserved.
-*/
-
-#include "ace/OS.h"
-#include "ace/Event_Handler.h"
-#include "ace/INET_Addr.h"
-#include "ace/Get_Opt.h"
-#include "ace/Log_Record.h"
-#include "ace/Message_Block.h"
-#include "ace/Message_Queue.h"
-#include "ace/Reactor.h"
-#include "ace/Service_Object.h"
-#include "ace/Signal.h"
-#include "ace/Synch.h"
-#include "ace/SOCK_Acceptor.h"
-#include "ace/SOCK_Connector.h"
-#include "ace/SOCK_Stream.h"
-#include "ace/Thread_Manager.h"
-#include "Logging_Acceptor.h"
-#include "CLD_export.h"
-
-
-#if !defined (FLUSH_TIMEOUT)
-#define FLUSH_TIMEOUT 120 /* 120 seconds == 2 minutes. */
-#endif /* FLUSH_TIMEOUT */
-
-
-class CLD_Connector;
-
-class CLD_Handler : public ACE_Event_Handler {
-public:
- enum { QUEUE_MAX = sizeof (ACE_Log_Record) * ACE_IOV_MAX };
-
- // Initialization hook method.
- virtual int open (CLD_Connector *);
- virtual int close (); // Shut down hook method.
-
- // Accessor to the connection to the logging server.
- virtual ACE_SOCK_Stream &peer () { return peer_; }
-
- // Reactor hook methods.
- virtual int handle_input (ACE_HANDLE handle);
- virtual int handle_close (ACE_HANDLE = ACE_INVALID_HANDLE,
- ACE_Reactor_Mask = 0);
-
-protected:
- // Forward log records to the server logging daemon.
- virtual ACE_THR_FUNC_RETURN forward ();
-
- // Send the buffered log records using a gather-write operation.
- virtual int send (ACE_Message_Block *chunk[], size_t &count);
-
- // Entry point into forwarder thread of control.
- static ACE_THR_FUNC_RETURN run_svc (void *arg);
-
- // A synchronized <ACE_Message_Queue> that queues messages.
- ACE_Message_Queue<ACE_SYNCH> msg_queue_;
-
- // Manage the forwarder thread.
- ACE_Thread_Manager thr_mgr_;
-
- // Pointer to our <CLD_Connector>.
- CLD_Connector *connector_;
-
- // Connection to the logging server.
- ACE_SOCK_Stream peer_;
-};
-
-
-class CLD_Connector {
-public:
- // Establish a connection to the logging server
- // at the <remote_addr>.
- int connect (CLD_Handler *handler,
- const ACE_INET_Addr &remote_addr);
-
- // Re-establish a connection to the logging server.
- int reconnect ();
-
-private:
- // Pointer to the <CLD_Handler> that we're connecting.
- CLD_Handler *handler_;
-
- // Address at which the logging server is listening
- // for connections.
- ACE_INET_Addr remote_addr_;
-};
-
-
-class CLD_Acceptor : public ACE_Event_Handler {
-public:
- // Initialization hook method.
- virtual int open (CLD_Handler *, const ACE_INET_Addr &,
- ACE_Reactor * = ACE_Reactor::instance ());
-
- // Reactor hook methods.
- virtual int handle_input (ACE_HANDLE handle);
- virtual int handle_close (ACE_HANDLE = ACE_INVALID_HANDLE,
- ACE_Reactor_Mask = 0);
- virtual ACE_HANDLE get_handle () const;
-
-protected:
- // Factory that passively connects <ACE_SOCK_Stream>s.
- ACE_SOCK_Acceptor acceptor_;
-
- // Pointer to the handler of log records.
- CLD_Handler *handler_;
-};
-
-/****************************************************/
-
-int CLD_Handler::handle_input (ACE_HANDLE handle) {
- ACE_Message_Block *mblk = 0;
- Logging_Handler logging_handler (handle);
-
- if (logging_handler.recv_log_record (mblk) != -1)
- if (msg_queue_.enqueue_tail (mblk->cont ()) != -1) {
- mblk->cont (0);
- mblk->release ();
- return 0; // Success return.
- } else mblk->release ();
- return -1; // Error return.
-}
-
-
-int CLD_Handler::handle_close (ACE_HANDLE handle,
- ACE_Reactor_Mask)
-{ return ACE_OS::closesocket (handle); }
-
-
-int CLD_Handler::open (CLD_Connector *connector) {
- connector_ = connector;
- int bufsiz = ACE_DEFAULT_MAX_SOCKET_BUFSIZ;
- peer ().set_option (SOL_SOCKET, SO_SNDBUF,
- &bufsiz, sizeof bufsiz);
- msg_queue_.high_water_mark (CLD_Handler::QUEUE_MAX);
- return thr_mgr_.spawn (&CLD_Handler::run_svc,
- this, THR_SCOPE_SYSTEM);
-}
-
-
-ACE_THR_FUNC_RETURN CLD_Handler::run_svc (void *arg) {
- CLD_Handler *handler = ACE_static_cast (CLD_Handler *, arg);
- return handler->forward ();
-}
-
-
-ACE_THR_FUNC_RETURN CLD_Handler::forward () {
- ACE_Message_Block *chunk[ACE_IOV_MAX];
- size_t message_index = 0;
- ACE_Time_Value time_of_last_send (ACE_OS::gettimeofday ());
- ACE_Time_Value timeout;
- ACE_Sig_Action no_sigpipe ((ACE_SignalHandler) SIG_IGN);
- ACE_Sig_Action original_action;
- no_sigpipe.register_action (SIGPIPE, &original_action);
-
- for (;;) {
- if (message_index == 0) {
- timeout = ACE_OS::gettimeofday ();
- timeout += FLUSH_TIMEOUT;
- }
- ACE_Message_Block *mblk = 0;
- if (msg_queue_.dequeue_head (mblk, &timeout) == -1) {
- if (errno != EWOULDBLOCK) break;
- else if (message_index == 0) continue;
- } else {
- if (mblk->size () == 0
- && mblk->msg_type () == ACE_Message_Block::MB_STOP)
- { mblk->release (); break; }
- chunk[message_index] = mblk;
- ++message_index;
- }
- if (message_index >= ACE_IOV_MAX ||
- (ACE_OS::gettimeofday () - time_of_last_send
- >= FLUSH_TIMEOUT)) {
- if (send (chunk, message_index) == -1) break;
- time_of_last_send = ACE_OS::gettimeofday ();
- }
- }
-
- if (message_index > 0) send (chunk, message_index);
- msg_queue_.close ();
- no_sigpipe.restore_action (SIGPIPE, original_action);
- return 0;
-}
-
-
-int CLD_Handler::send (ACE_Message_Block *chunk[], size_t &count) {
- iovec iov[ACE_IOV_MAX];
- size_t iov_size;
- int result = 0;
-
- for (iov_size = 0; iov_size < count; ++iov_size) {
- iov[iov_size].iov_base = chunk[iov_size]->rd_ptr ();
- iov[iov_size].iov_len = chunk[iov_size]->length ();
- }
- while (peer ().sendv_n (iov, iov_size) == -1)
- if (connector_->reconnect () == -1) {
- result = -1;
- break;
- }
-
- while (iov_size > 0) {
- chunk[--iov_size]->release (); chunk[iov_size] = 0;
- }
- count = iov_size;
- return result;
-}
-
-
-int CLD_Handler::close () {
- ACE_Message_Block *shutdown_message = 0;
- ACE_NEW_RETURN
- (shutdown_message,
- ACE_Message_Block (0, ACE_Message_Block::MB_STOP), -1);
- msg_queue_.enqueue_tail (shutdown_message);
- return thr_mgr_.wait ();
-}
-
-/**************************************************************/
-
-
-int CLD_Acceptor::open (CLD_Handler *handler,
- const ACE_INET_Addr &local_addr,
- ACE_Reactor *r) {
- reactor (r); // Store the reactor pointer.
- handler_ = handler;
- if (acceptor_.open (local_addr) == -1
- || reactor ()->register_handler
- (this, ACE_Event_Handler::ACCEPT_MASK) == -1)
- return -1;
- return 0;
-}
-
-
-ACE_HANDLE CLD_Acceptor::get_handle () const
-{ return acceptor_.get_handle (); }
-
-
-int CLD_Acceptor::handle_input (ACE_HANDLE) {
- ACE_SOCK_Stream peer_stream;
- if (acceptor_.accept (peer_stream) == -1) return -1;
- else if (reactor ()->register_handler
- (peer_stream.get_handle (),
- handler_,
- ACE_Event_Handler::READ_MASK) == -1)
- return -1;
- else return 0;
-}
-
-
-int CLD_Acceptor::handle_close (ACE_HANDLE, ACE_Reactor_Mask) {
- acceptor_.close ();
- handler_->close ();
- return 0;
-}
-
-
-/***************************************************/
-
-
-int CLD_Connector::connect
- (CLD_Handler *handler,
- const ACE_INET_Addr &remote_addr) {
- ACE_SOCK_Connector connector;
-
- if (connector.connect (handler->peer (), remote_addr) == -1)
- return -1;
- else if (handler->open (this) == -1)
- { handler->handle_close (); return -1; }
- handler_ = handler;
- remote_addr_ = remote_addr;
- return 0;
-}
-
-
-int CLD_Connector::reconnect () {
- // Maximum number of times to retry connect.
- const size_t MAX_RETRIES = 5;
-
- ACE_SOCK_Connector connector;
- ACE_Time_Value timeout (1); // Start with 1 second timeout.
- size_t i;
- for (i = 0; i < MAX_RETRIES; ++i) {
- if (i > 0) ACE_OS::sleep (timeout);
- if (connector.connect (handler_->peer (), remote_addr_,
- &timeout) == -1)
- timeout *= 2; // Exponential backoff.
- else {
- int bufsiz = ACE_DEFAULT_MAX_SOCKET_BUFSIZ;
- handler_->peer ().set_option (SOL_SOCKET, SO_SNDBUF,
- &bufsiz, sizeof bufsiz);
- break;
- }
- }
- return i == MAX_RETRIES ? -1 : 0;
-}
-
-
-/*******************************************************/
-
-class Client_Logging_Daemon : public ACE_Service_Object {
-public:
- virtual ~Client_Logging_Daemon () {} // Turn off g++ warnings.
-
- // Service Configurator hook methods.
- virtual int init (int argc, ACE_TCHAR *argv[]);
- virtual int fini ();
-#if 0
- // Implementing these methods is left as an exercise for the reader.
- virtual int info (ACE_TCHAR **bufferp, size_t length = 0) const;
- virtual int suspend ();
- virtual int resume ();
-#endif
-
-protected:
- // Receives, processes, and forwards log records.
- CLD_Handler handler_;
-
- // Factory that passively connects the <CLD_Handler>.
- CLD_Acceptor acceptor_;
-
- // Factory that actively connects the <CLD_Handler>.
- CLD_Connector connector_;
-};
-
-
-int Client_Logging_Daemon::init (int argc, ACE_TCHAR *argv[]) {
- u_short cld_port = ACE_DEFAULT_SERVICE_PORT;
- u_short sld_port = ACE_DEFAULT_LOGGING_SERVER_PORT;
- ACE_TCHAR sld_host[MAXHOSTNAMELEN];
- ACE_OS_String::strcpy (sld_host, ACE_LOCALHOST);
-
- ACE_Get_Opt get_opt (argc, argv, ACE_TEXT ("p:r:s:"), 0);
- get_opt.long_option (ACE_TEXT ("client_port"), 'p',
- ACE_Get_Opt::ARG_REQUIRED);
- get_opt.long_option (ACE_TEXT ("server_port"), 'r',
- ACE_Get_Opt::ARG_REQUIRED);
- get_opt.long_option (ACE_TEXT ("server_name"), 's',
- ACE_Get_Opt::ARG_REQUIRED);
-
- for (int c; (c = get_opt ()) != -1;)
- switch (c) {
- case 'p': // Client logging daemon acceptor port number.
- cld_port = ACE_static_cast
- (u_short, ACE_OS::atoi (get_opt.opt_arg ()));
- break;
- case 'r': // Server logging daemon acceptor port number.
- sld_port = ACE_static_cast
- (u_short, ACE_OS::atoi (get_opt.opt_arg ()));
- break;
- case 's': // Server logging daemon hostname.
- ACE_OS_String::strsncpy
- (sld_host, get_opt.opt_arg (), MAXHOSTNAMELEN);
- break;
- }
-
- ACE_INET_Addr cld_addr (cld_port);
- ACE_INET_Addr sld_addr (sld_port, sld_host);
-
- if (acceptor_.open (&handler_, cld_addr) == -1)
- return -1;
- else if (connector_.connect (&handler_, sld_addr) == -1)
- { acceptor_.handle_close (); return -1; }
- return 0;
-}
-
-
-int Client_Logging_Daemon::fini () {
- acceptor_.handle_close ();
- handler_.close ();
- return 0;
-}
-
-
-ACE_FACTORY_DEFINE (CLD, Client_Logging_Daemon)
diff --git a/examples/C++NPv2/Configurable_Logging_Server.cpp b/examples/C++NPv2/Configurable_Logging_Server.cpp
deleted file mode 100644
index 7ba77999b42..00000000000
--- a/examples/C++NPv2/Configurable_Logging_Server.cpp
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
-** $Id$
-**
-** Copyright 2002 Addison Wesley. All Rights Reserved.
-*/
-
-#include "ace/OS.h"
-#include "ace/Service_Config.h"
-#include "ace/Reactor.h"
-
-int ACE_TMAIN (int argc, ACE_TCHAR *argv[]) {
-
- ACE_STATIC_SVC_REGISTER (Reporter_Descriptor);
-
- ACE_Service_Config::open
- (argc, argv, ACE_DEFAULT_LOGGER_KEY, 0);
-
- ACE_Reactor::instance ()->run_reactor_event_loop ();
- return 0;
-}
diff --git a/examples/C++NPv2/Configurable_Logging_Server.dsp b/examples/C++NPv2/Configurable_Logging_Server.dsp
deleted file mode 100644
index ad0c33fc7e4..00000000000
--- a/examples/C++NPv2/Configurable_Logging_Server.dsp
+++ /dev/null
@@ -1,112 +0,0 @@
-# Microsoft Developer Studio Project File - Name="Configurable_Logging_Server" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=Configurable_Logging_Server - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "Configurable_Logging_Server.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "Configurable_Logging_Server.mak" CFG="Configurable_Logging_Server - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "Configurable_Logging_Server - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "Configurable_Logging_Server - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "Configurable_Logging_Server - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Configurable_Logging_Server___Win32_Release"
-# PROP BASE Intermediate_Dir "Configurable_Logging_Server___Win32_Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c
-# SUBTRACT CPP /YX
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 ace.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\ace"
-
-!ELSEIF "$(CFG)" == "Configurable_Logging_Server - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Configurable_Logging_Server___Win32_Debug"
-# PROP BASE Intermediate_Dir "Configurable_Logging_Server___Win32_Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\.." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c
-# SUBTRACT CPP /YX
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 aced.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\ace"
-
-!ENDIF
-
-# Begin Target
-
-# Name "Configurable_Logging_Server - Win32 Release"
-# Name "Configurable_Logging_Server - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\Configurable_Logging_Server.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\Service_Reporter.cpp
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\Service_Reporter.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/examples/C++NPv2/Logging_Acceptor.cpp b/examples/C++NPv2/Logging_Acceptor.cpp
deleted file mode 100644
index 2e7b7479603..00000000000
--- a/examples/C++NPv2/Logging_Acceptor.cpp
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
-** $Id$
-**
-** Copyright 2002 Addison Wesley. All Rights Reserved.
-*/
-
-#include "Logging_Acceptor.h"
-#include "Logging_Event_Handler.h"
-
-
-int Logging_Acceptor::open (const ACE_INET_Addr &local_addr) {
- if (acceptor_.open (local_addr) == -1) return -1;
- return reactor ()->register_handler
- (this, ACE_Event_Handler::ACCEPT_MASK);
-}
-
-int Logging_Acceptor::handle_input (ACE_HANDLE) {
- Logging_Event_Handler *peer_handler = 0;
- ACE_NEW_RETURN (peer_handler,
- Logging_Event_Handler (reactor ()),
- -1);
-
- if (acceptor_.accept (peer_handler->peer ()) == -1) {
- delete peer_handler;
- return -1;
- } else if (peer_handler->open () == -1) {
- peer_handler->handle_close ();
- return -1;
- }
- return 0;
-}
-
-int Logging_Acceptor::handle_close (ACE_HANDLE,
- ACE_Reactor_Mask) {
- acceptor_.close ();
- delete this;
- return 0;
-}
diff --git a/examples/C++NPv2/Logging_Acceptor.h b/examples/C++NPv2/Logging_Acceptor.h
deleted file mode 100644
index 7d38439e3eb..00000000000
--- a/examples/C++NPv2/Logging_Acceptor.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
-** $Id$
-**
-** Copyright 2002 Addison Wesley. All Rights Reserved.
-*/
-
-#ifndef _LOGGING_ACCEPTOR_H
-#define _LOGGING_ACCEPTOR_H
-
-#include "ace/Event_Handler.h"
-#include "ace/INET_Addr.h"
-#include "ace/Log_Record.h"
-#include "ace/Reactor.h"
-#include "ace/SOCK_Acceptor.h"
-#include "ace/SOCK_Stream.h"
-#include "Logging_Handler.h"
-
-class Logging_Acceptor : public ACE_Event_Handler
-{
-protected:
- // Factory that connects <ACE_SOCK_Stream>s passively.
- ACE_SOCK_Acceptor acceptor_;
-
-protected:
- virtual ~Logging_Acceptor () {}; // No-op destructor.
-
-public:
- typedef ACE_INET_Addr PEER_ADDR;
-
- // Simple constructor.
- Logging_Acceptor (ACE_Reactor *r = ACE_Reactor::instance ())
- : ACE_Event_Handler (r) {};
-
- // Initialization method.
- virtual int open (const ACE_INET_Addr &local_addr);
-
- // Called by a reactor when there's a new connection to accept.
- virtual int handle_input (ACE_HANDLE = ACE_INVALID_HANDLE);
-
- // Called when this object is destroyed, e.g., when it's
- // removed from a reactor.
- virtual int handle_close (ACE_HANDLE = ACE_INVALID_HANDLE,
- ACE_Reactor_Mask = 0);
-
- // Return the passive-mode socket's I/O handle.
- virtual ACE_HANDLE get_handle () const
- { return acceptor_.get_handle (); };
-
- // Returns a reference to the underlying <acceptor_>.
- ACE_SOCK_Acceptor &acceptor () { return acceptor_; };
-};
-
-#endif /* _LOGGING_ACCEPTOR_H */
diff --git a/examples/C++NPv2/Logging_Acceptor_Ex.h b/examples/C++NPv2/Logging_Acceptor_Ex.h
deleted file mode 100644
index 913ae385db6..00000000000
--- a/examples/C++NPv2/Logging_Acceptor_Ex.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
-** $Id$
-**
-** Copyright 2002 Addison Wesley. All Rights Reserved.
-*/
-
-#ifndef _LOGGING_ACCEPTOR_EX_H
-#define _LOGGING_ACCEPTOR_EX_H
-
-#include "ace/INET_Addr.h"
-#include "ace/Reactor.h"
-
-#include "Logging_Acceptor.h"
-#include "Logging_Event_Handler_Ex.h"
-
-class Logging_Acceptor_Ex : public Logging_Acceptor
-{
-public:
- typedef ACE_INET_Addr PEER_ADDR;
-
- // Simple constructor to pass ACE_Reactor to base class.
- Logging_Acceptor_Ex (ACE_Reactor *r = ACE_Reactor::instance ())
- : Logging_Acceptor (r) {}
-
- int handle_input (ACE_HANDLE) {
- Logging_Event_Handler_Ex *peer_handler = 0;
- ACE_NEW_RETURN (peer_handler,
- Logging_Event_Handler_Ex (reactor ()),
- -1);
- if (acceptor_.accept (peer_handler->peer ()) == -1) {
- delete peer_handler;
- return -1;
- } else if (peer_handler->open () == -1) {
- peer_handler->handle_close ();
- return -1;
- }
- return 0;
- }
-};
-
-#endif /* _LOGGING_ACCEPTOR_EX_H */
diff --git a/examples/C++NPv2/Logging_Event_Handler.cpp b/examples/C++NPv2/Logging_Event_Handler.cpp
deleted file mode 100644
index e6de908074d..00000000000
--- a/examples/C++NPv2/Logging_Event_Handler.cpp
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
-** $Id$
-**
-** Copyright 2002 Addison Wesley. All Rights Reserved.
-*/
-
-#include "ace/FILE_Connector.h"
-
-#include "Logging_Event_Handler.h"
-
-int Logging_Event_Handler::open () {
-
- static const char LOGFILE_SUFFIX[] = ".log";
- char filename[MAXHOSTNAMELEN + sizeof (LOGFILE_SUFFIX)];
- ACE_INET_Addr logging_peer_addr;
-
- logging_handler_.peer ().get_remote_addr (logging_peer_addr);
- logging_peer_addr.get_host_name (filename, MAXHOSTNAMELEN);
- strcat (filename, LOGFILE_SUFFIX);
-
- ACE_FILE_Connector connector;
- connector.connect (log_file_,
- ACE_FILE_Addr (filename),
- 0, // No timeout.
- ACE_Addr::sap_any, // Ignored.
- 0, // Don't try to reuse the addr.
- O_RDWR|O_CREAT|O_APPEND,
- ACE_DEFAULT_FILE_PERMS);
-
- return reactor ()->register_handler
- (this, ACE_Event_Handler::READ_MASK);
-}
-
-int Logging_Event_Handler::handle_input (ACE_HANDLE)
-{ return logging_handler_.log_record (); }
-
-int Logging_Event_Handler::handle_close (ACE_HANDLE,
- ACE_Reactor_Mask) {
- logging_handler_.close ();
- log_file_.close ();
- delete this;
- return 0;
-}
diff --git a/examples/C++NPv2/Logging_Event_Handler.h b/examples/C++NPv2/Logging_Event_Handler.h
deleted file mode 100644
index 614649daba8..00000000000
--- a/examples/C++NPv2/Logging_Event_Handler.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
-** $Id$
-**
-** Copyright 2002 Addison Wesley. All Rights Reserved.
-*/
-
-#ifndef _LOGGING_EVENT_HANDLER_H
-#define _LOGGING_EVENT_HANDLER_H
-
-#include "ace/Event_Handler.h"
-#include "ace/FILE_IO.h"
-#include "ace/Reactor.h"
-#include "ace/SOCK_Stream.h"
-
-#include "Logging_Handler.h"
-
-class Logging_Event_Handler : public ACE_Event_Handler
-{
-protected:
- // File where log records are written.
- ACE_FILE_IO log_file_;
-
- // Connection to remote peer.
- Logging_Handler logging_handler_;
-
-public:
- // Initialize the base class and logging handler.
- Logging_Event_Handler (ACE_Reactor *reactor)
- : ACE_Event_Handler (reactor),
- logging_handler_ (log_file_) {};
-
- virtual ~Logging_Event_Handler () {}; // No-op destructor.
-
- // Activate the object.
- virtual int open ();
-
- // Called by a reactor when logging events arrive.
- virtual int handle_input (ACE_HANDLE = ACE_INVALID_HANDLE);
-
- // Called when this object is destroyed, e.g., when it's
- // removed from a reactor.
- virtual int handle_close (ACE_HANDLE = ACE_INVALID_HANDLE,
- ACE_Reactor_Mask = 0);
-
- // Return socket handle of the contained <Logging_Handler>.
- virtual ACE_HANDLE get_handle (void) const {
- // Need a non-const reference to call peer(), but that's
- // safe since we call a const method using it.
- Logging_Handler& h =
- ACE_const_cast (Logging_Handler&, logging_handler_);
- return h.peer ().get_handle ();
- };
-
- // Get a reference to the contained <ACE_SOCK_Stream>.
- ACE_SOCK_Stream &peer () { return logging_handler_.peer (); };
-
- // Return a reference to the <log_file_>.
- ACE_FILE_IO &log_file () { return log_file_; };
-};
-
-#endif /* _LOGGING_EVENT_HANDLER_H */
diff --git a/examples/C++NPv2/Logging_Event_Handler_Ex.cpp b/examples/C++NPv2/Logging_Event_Handler_Ex.cpp
deleted file mode 100644
index 73528289015..00000000000
--- a/examples/C++NPv2/Logging_Event_Handler_Ex.cpp
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
-** $Id$
-**
-** Copyright 2002 Addison Wesley. All Rights Reserved.
-*/
-
-#include "Logging_Event_Handler_Ex.h"
-
-int Logging_Event_Handler_Ex::handle_input (ACE_HANDLE h) {
- time_of_last_log_record_ =
- reactor ()->timer_queue ()->gettimeofday ();
- return PARENT::handle_input (h);
-}
-
-int Logging_Event_Handler_Ex::open () {
- int result = PARENT::open ();
- if (result != -1) {
- ACE_Time_Value reschedule (max_client_timeout_.sec () / 4);
- result =
- reactor ()->schedule_timer
- (this,
- 0,
- max_client_timeout_, // Initial timeout.
- reschedule); // Subsequent timeouts.
- }
- return result;
-}
-
-int Logging_Event_Handler_Ex::handle_timeout
- (const ACE_Time_Value &now, const void *) {
- if (now - time_of_last_log_record_ >= max_client_timeout_)
- reactor ()->remove_handler (this, ACE_Event_Handler::READ_MASK);
- return 0;
-}
-
-int Logging_Event_Handler_Ex::handle_close (ACE_HANDLE,
- ACE_Reactor_Mask) {
- reactor ()->cancel_timer (this);
- return PARENT::handle_close ();
-}
diff --git a/examples/C++NPv2/Logging_Event_Handler_Ex.h b/examples/C++NPv2/Logging_Event_Handler_Ex.h
deleted file mode 100644
index 020766c2630..00000000000
--- a/examples/C++NPv2/Logging_Event_Handler_Ex.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
-** $Id$
-**
-** Copyright 2002 Addison Wesley. All Rights Reserved.
-*/
-
-#ifndef _LOGGING_EVENT_HANDLER_EX_H
-#define _LOGGING_EVENT_HANDLER_EX_H
-
-#include "ace/Reactor.h"
-#include "ace/Time_Value.h"
-
-#include "Logging_Event_Handler.h"
-
-class Logging_Event_Handler_Ex : public Logging_Event_Handler
-{
-private:
- // Time when a client last sent a log record.
- ACE_Time_Value time_of_last_log_record_;
-
- // Maximum time to wait for a client log record.
- const ACE_Time_Value max_client_timeout_;
-
-public:
- typedef Logging_Event_Handler PARENT;
-
- // 3600 seconds == one hour.
- enum { MAX_CLIENT_TIMEOUT = 3600 };
-
- Logging_Event_Handler_Ex
- (ACE_Reactor *reactor,
- const ACE_Time_Value &max_client_timeout
- = ACE_Time_Value (MAX_CLIENT_TIMEOUT))
- : Logging_Event_Handler (reactor),
- time_of_last_log_record_ (0),
- max_client_timeout_ (max_client_timeout) {}
-
- virtual ~Logging_Event_Handler_Ex () {}
-
- virtual int open (); // Activate the event handler.
-
- // Called by a reactor when logging events arrive.
- virtual int handle_input (ACE_HANDLE);
-
- // Called when a timeout expires to check if the client has
- // been idle for an excessive amount of time.
- virtual int handle_timeout (const ACE_Time_Value &tv,
- const void *act);
-
- // Called when this object is destroyed, e.g., when it's
- // removed from a reactor.
- virtual int handle_close (ACE_HANDLE = ACE_INVALID_HANDLE,
- ACE_Reactor_Mask = 0);
-};
-
-#endif /* _LOGGING_EVENT_HANDLER_EX_H */
diff --git a/examples/C++NPv2/Logging_Handler.cpp b/examples/C++NPv2/Logging_Handler.cpp
deleted file mode 100644
index 9524d7111e6..00000000000
--- a/examples/C++NPv2/Logging_Handler.cpp
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
-** $Id$
-**
-** Copyright 2001 Addison Wesley. All Rights Reserved.
-*/
-
-#include "ace/ACE.h"
-#include "ace/CDR_Stream.h"
-#include "ace/INET_Addr.h"
-#include "ace/Log_Record.h"
-#include "ace/Message_Block.h"
-
-#include "Logging_Handler.h"
-
-
-int operator>> (ACE_InputCDR &cdr, ACE_Log_Record &log_record)
-{
- ACE_CDR::Long type;
- ACE_CDR::Long pid;
- ACE_CDR::Long sec, usec;
- ACE_CDR::ULong buffer_len;
-
- // Extract each field from input CDR stream into <log_record>.
- if ((cdr >> type) && (cdr >> pid) && (cdr >> sec) && (cdr >> usec)
- && (cdr >> buffer_len)) {
- ACE_TCHAR log_msg[ACE_Log_Record::MAXLOGMSGLEN+1];
- log_record.type (type);
- log_record.pid (pid);
- log_record.time_stamp (ACE_Time_Value (sec, usec));
- cdr.read_char_array (log_msg, buffer_len);
- log_msg[buffer_len] = '\0';
- log_record.msg_data (log_msg);
- }
- return cdr.good_bit ();
-}
-
-
-int Logging_Handler::recv_log_record (ACE_Message_Block *&mblk)
-{
- // Put <logging_peer>'s hostname in new message block.
- ACE_INET_Addr peer_addr;
- logging_peer_.get_remote_addr (peer_addr);
- mblk = new ACE_Message_Block (MAXHOSTNAMELEN + 1);
- peer_addr.get_host_name (mblk->wr_ptr (), MAXHOSTNAMELEN);
- mblk->wr_ptr (strlen (mblk->wr_ptr ()) + 1); // Go past name
-
- // Allocate a message block for the payload; initially at least
- // large enough to hold the header, but needs some room for
- // alignment.
- ACE_Message_Block *payload =
- new ACE_Message_Block (ACE_DEFAULT_CDR_BUFSIZE);
- // Align the Message Block for a CDR stream
- ACE_CDR::mb_align (payload);
- if (logging_peer_.recv_n (payload->wr_ptr (), 8) == 8) {
- payload->wr_ptr (8); // Reflect addition of 8 bytes
-
- // Create a CDR stream to parse the 8-byte header.
- ACE_InputCDR cdr (payload);
-
- // Extract the byte-order and use helper methods to
- // disambiguate octet, booleans, and chars.
- ACE_CDR::Boolean byte_order;
- cdr >> ACE_InputCDR::to_boolean (byte_order);
-
- // Set the byte-order on the stream...
- cdr.reset_byte_order (byte_order);
-
- // Extract the length
- ACE_CDR::ULong length;
- cdr >> length;
-
- // Ensure there's sufficient room for log record payload.
- ACE_CDR::grow (payload, 8 + ACE_CDR::MAX_ALIGNMENT + length);
-
- // Use <recv_n> to obtain the contents.
- if (logging_peer_.recv_n (payload->wr_ptr (), length) > 0) {
- payload->wr_ptr (length); // Reflect additional bytes
- // Chain the payload to mblk via the contination field.
- mblk->cont (payload);
- return length;
- }
- }
- // Error cases end up here, so we need to release the memory to
- // prevent a leak.
- payload->release ();
- payload = 0;
- mblk->release ();
- mblk = 0;
- return -1;
-}
-
-
-int Logging_Handler::write_log_record (ACE_Message_Block *mblk)
-{
- // Peer hostname is in the <mblk> and the log record data
- // is in its continuation.
- if (log_file_->send_n (mblk) == -1)
- return -1;
- if (ACE::debug ()) {
- // Build a CDR stream from the log record data.
- ACE_InputCDR cdr (mblk->cont ());
- ACE_CDR::Boolean byte_order;
- ACE_CDR::ULong length;
- // Extract the byte-order and length, ending up at the start
- // of the log record itself. Use the byte order to properly
- // set the CDR stream for extracting the contents.
- cdr >> ACE_InputCDR::to_boolean (byte_order);
- cdr.reset_byte_order (byte_order);
- cdr >> length;
- ACE_Log_Record log_record;
- cdr >> log_record; // Finally extract the <ACE_log_record>.
- log_record.print (mblk->rd_ptr (), 1, cerr);
- }
- return mblk->total_length ();
-}
-
-
-int Logging_Handler::log_record ()
-{
- ACE_Message_Block *mblk = 0;
- if (recv_log_record (mblk) == -1)
- return -1;
- else {
- int result = write_log_record (mblk);
- mblk->release (); // Free up the contents.
- return result == -1 ? -1 : 0;
- }
-}
diff --git a/examples/C++NPv2/Logging_Handler.h b/examples/C++NPv2/Logging_Handler.h
deleted file mode 100644
index e92a89a8147..00000000000
--- a/examples/C++NPv2/Logging_Handler.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
-** $Id$
-**
-** Copyright 2001 Addison Wesley. All Rights Reserved.
-*/
-
-#ifndef _LOGGING_HANDLER_H
-#define _LOGGING_HANDLER_H
-
-#include "ace/FILE_IO.h"
-#include "ace/SOCK_Stream.h"
-
-class ACE_Message_Block;
-
-class Logging_Handler
-{
-protected:
- ACE_FILE_IO *log_file_; // Pointer to a log file.
-
- ACE_SOCK_Stream logging_peer_; // Connected to the client.
-
-public:
- // Initialization and termination methods.
- Logging_Handler (ACE_FILE_IO &log_file): log_file_ (&log_file) {};
- Logging_Handler (ACE_FILE_IO &log_file,
- ACE_HANDLE handle): log_file_ (&log_file)
- { logging_peer_.set_handle (handle); };
- Logging_Handler (ACE_FILE_IO &log_file,
- const ACE_SOCK_Stream &logging_peer)
- : log_file_ (&log_file), logging_peer_ (logging_peer) {};
- Logging_Handler (const ACE_SOCK_Stream &logging_peer)
- : log_file_ (0), logging_peer_ (logging_peer) {};
- int close () { return logging_peer_.close (); };
-
- // Receive one log record from a connected client. Returns
- // length of record on success and <mblk> contains the
- // hostname, <mblk->cont()> contains the log record header
- // (the byte order and the length) and the data. Returns -1 on
- // failure or connection close.
- int recv_log_record (ACE_Message_Block *&log_record);
-
- // Write one record to the log file. The <mblk> contains the
- // hostname and the <mblk->cont> contains the log record.
- // Returns length of record written on success, or -1 on failure.
- int write_log_record (ACE_Message_Block *log_record);
-
- // Log one record by calling <recv_log_record> and
- // <write_log_record>. Returns 0 on success and -1 on failure.
- int log_record ();
-
- // Accessor method.
- ACE_SOCK_Stream &peer () { return logging_peer_; };
-};
-
-#endif /* _LOGGING_HANDLER_H */
diff --git a/examples/C++NPv2/Makefile b/examples/C++NPv2/Makefile
deleted file mode 100644
index e9442f1d9d6..00000000000
--- a/examples/C++NPv2/Makefile
+++ /dev/null
@@ -1,62 +0,0 @@
-#----------------------------------------------------------------------------
-#
-# $Id$
-#
-# Makefile for C++NPv2 example programs.
-#----------------------------------------------------------------------------
-
-#----------------------------------------------------------------------------
-# Local macros
-#----------------------------------------------------------------------------
-
-#----------------------------------------------------------------------------
-# Local macros
-#----------------------------------------------------------------------------
-MAKEFILE=Makefile
-
-# These examples don't require SSL support... those that do are below.
-MKLIST = Makefile.Reactor_Logging_Server \
- Makefile.Select_Reactor_Logging_Server \
- Makefile.TP_Reactor_Logging_Server \
- Makefile.Configurable_Logging_Server \
- Makefile.SLD \
- Makefile.SLDex \
- Makefile.CLD \
- Makefile.TPLS \
- Makefile.SR_Configurable_Logging_Server \
- Makefile.display_logfile
-
-ifneq ($(ssl),)
- MKLIST += Makefile.AC_CLD Makefile.AIO_CLD Makefile.TPCLS
-endif # ssl
-
-## Ensure that Makefiles in MKLIST are executed in sequence during a
-## parallel build because we share some files between multiple libraries.
-.NOTPARALLEL:
-
-## Makefile.Reactive_Logging_Server.mkfile is a dummy target which will cause
-## $(MAKE) -f Makefile.Reactive_Logging_Server to be invoked, then it cleans
-## up tempinc when needed for AIX Visual Age C++.
-%.mkfile: %
- @echo $(MAKE) -f $< $(MKFILE_TARGET)
- @$(MAKE) -f $< $(MKFILE_TARGET)
- -@$(RM) -rf tempinc
-
-# This rule invokes make again with the list of .mkfile targets as a
-# parameter. For example, if the all target is being made, make is invoked
-# as follows:
-#
-# make -f Makefile MKFILE_TARGET=all Makefile.Reactive_Logging_Server_Ex
-
-all clean depend realclean:
-ifneq ($(MKLIST),)
- @echo $(MAKE) -f $(MAKEFILE) MKFILE_TARGET=$@ $(addsuffix .mkfile, $(MKLIST))
- @$(MAKE) -f $(MAKEFILE) MKFILE_TARGET=$@ $(addsuffix .mkfile, $(MKLIST))
-endif
-
-# DO NOT DELETE THIS LINE -- g++dep uses it.
-# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.
-
-
-
-# IF YOU PUT ANYTHING HERE IT WILL GO AWAY
diff --git a/examples/C++NPv2/Makefile.AC_CLD b/examples/C++NPv2/Makefile.AC_CLD
deleted file mode 100644
index fc5972e00a1..00000000000
--- a/examples/C++NPv2/Makefile.AC_CLD
+++ /dev/null
@@ -1,48 +0,0 @@
-#----------------------------------------------------------------------------
-# $Id$
-#
-# Makefile for the AC_CLD library in the C++NPv2, Chapter 7 example.
-#----------------------------------------------------------------------------
-
-#----------------------------------------------------------------------------
-# Local macros
-#----------------------------------------------------------------------------
-
-# This example uses SSL.
-ifeq ($(ssl),)
-default:
- @echo 'This example requires SSL; build with make ssl=1'
-endif #ssl
-
-SHLIB = libAC_CLD.$(SOEXT)
-FILES = AC_Client_Logging_Daemon \
- Logging_Handler
-LSRC = $(addsuffix .cpp,$(FILES))
-
-LIBS += $(ACELIB)
-
-BUILD = $(VSHLIB)
-
-#----------------------------------------------------------------------------
-# Include macros and targets
-#----------------------------------------------------------------------------
-
-include $(ACE_ROOT)/include/makeinclude/wrapper_macros.GNU
-include $(ACE_ROOT)/include/makeinclude/macros.GNU
-include $(ACE_ROOT)/include/makeinclude/rules.common.GNU
-include $(ACE_ROOT)/include/makeinclude/rules.nonested.GNU
-include $(ACE_ROOT)/include/makeinclude/rules.lib.GNU
-include $(ACE_ROOT)/include/makeinclude/rules.local.GNU
-
-# To remake the DLL_Test source with xlC on AIX, it works
-# best to wipe out any previously-created tempinc directory.
-# The compiler/linker isn't too smart about instantiating templates...
-ifdef TEMPINCDIR
-COMPILE.cc := $(RM) -rf tempinc; $(COMPILE.cc)
-endif
-
-ifneq ($(ssl),)
- CPPFLAGS += $(PLATFORM_SSL_CPPFLAGS)
- LIBS += $(PLATFORM_SSL_LIBS)
- LDFLAGS += $(PLATFORM_SSL_LDFLAGS)
-endif # ssl
diff --git a/examples/C++NPv2/Makefile.AIO_CLD b/examples/C++NPv2/Makefile.AIO_CLD
deleted file mode 100644
index fe7c522a6ec..00000000000
--- a/examples/C++NPv2/Makefile.AIO_CLD
+++ /dev/null
@@ -1,47 +0,0 @@
-#----------------------------------------------------------------------------
-# $Id$
-#
-# Makefile for the AIO_CLD library in the C++NPv2, Chapter 8 example.
-#----------------------------------------------------------------------------
-
-#----------------------------------------------------------------------------
-# Local macros
-#----------------------------------------------------------------------------
-
-# This example uses SSL.
-ifeq ($(ssl),)
-default:
- @echo 'This example requires SSL; build with make ssl=1'
-endif #ssl
-
-SHLIB = libAIO_CLD.$(SOEXT)
-FILES = AIO_Client_Logging_Daemon
-LSRC = $(addsuffix .cpp,$(FILES))
-
-LIBS += $(ACELIB)
-
-BUILD = $(VSHLIB)
-
-#----------------------------------------------------------------------------
-# Include macros and targets
-#----------------------------------------------------------------------------
-
-include $(ACE_ROOT)/include/makeinclude/wrapper_macros.GNU
-include $(ACE_ROOT)/include/makeinclude/macros.GNU
-include $(ACE_ROOT)/include/makeinclude/rules.common.GNU
-include $(ACE_ROOT)/include/makeinclude/rules.nonested.GNU
-include $(ACE_ROOT)/include/makeinclude/rules.lib.GNU
-include $(ACE_ROOT)/include/makeinclude/rules.local.GNU
-
-# To remake the DLL_Test source with xlC on AIX, it works
-# best to wipe out any previously-created tempinc directory.
-# The compiler/linker isn't too smart about instantiating templates...
-ifdef TEMPINCDIR
-COMPILE.cc := $(RM) -rf tempinc; $(COMPILE.cc)
-endif
-
-ifneq ($(ssl),)
- CPPFLAGS += $(PLATFORM_SSL_CPPFLAGS)
- LIBS += $(PLATFORM_SSL_LIBS)
- LDFLAGS += $(PLATFORM_SSL_LDFLAGS)
-endif # ssl
diff --git a/examples/C++NPv2/Makefile.CLD b/examples/C++NPv2/Makefile.CLD
deleted file mode 100644
index 35dfdbf3de5..00000000000
--- a/examples/C++NPv2/Makefile.CLD
+++ /dev/null
@@ -1,41 +0,0 @@
-#----------------------------------------------------------------------------
-# $Id$
-#
-# Makefile for the CLD library in the C++NPv2, Chapter 6 example.
-#----------------------------------------------------------------------------
-
-#----------------------------------------------------------------------------
-# Local macros
-#----------------------------------------------------------------------------
-
-SHLIB = libCLD.$(SOEXT)
-FILES = Client_Logging_Daemon \
- Logging_Acceptor \
- Logging_Event_Handler \
- Logging_Handler
-LSRC = $(addsuffix .cpp,$(FILES))
-
-LIBS += $(ACELIB)
-
-BUILD = $(VSHLIB)
-
-#----------------------------------------------------------------------------
-# Include macros and targets
-#----------------------------------------------------------------------------
-
-include $(ACE_ROOT)/include/makeinclude/wrapper_macros.GNU
-include $(ACE_ROOT)/include/makeinclude/macros.GNU
-include $(ACE_ROOT)/include/makeinclude/rules.common.GNU
-include $(ACE_ROOT)/include/makeinclude/rules.nonested.GNU
-include $(ACE_ROOT)/include/makeinclude/rules.lib.GNU
-include $(ACE_ROOT)/include/makeinclude/rules.local.GNU
-
-#----------------------------------------------------------------------------
-# Local targets
-#----------------------------------------------------------------------------
-
-ifeq ($(shared_libs),1)
-ifneq ($(SHLIB),)
-CPPFLAGS += -DCLD_BUILD_DLL
-endif
-endif
diff --git a/examples/C++NPv2/Makefile.Configurable_Logging_Server b/examples/C++NPv2/Makefile.Configurable_Logging_Server
deleted file mode 100644
index ccb83bd0b70..00000000000
--- a/examples/C++NPv2/Makefile.Configurable_Logging_Server
+++ /dev/null
@@ -1,30 +0,0 @@
-#----------------------------------------------------------------------------
-#
-# $Id$
-#
-# Makefile for C++NPv2 Configurable_Logging_Server example program, chapter 5.
-#----------------------------------------------------------------------------
-
-#----------------------------------------------------------------------------
-# Local macros
-#----------------------------------------------------------------------------
-
-BIN = Configurable_Logging_Server
-
-FILES = Service_Reporter
-
-SRC = $(addsuffix .cpp,$(FILES))
-OBJ = $(addsuffix .o,$(FILES))
-
-BUILD = $(VBIN)
-
-#----------------------------------------------------------------------------
-# Include macros and targets
-#----------------------------------------------------------------------------
-
-include $(ACE_ROOT)/include/makeinclude/wrapper_macros.GNU
-include $(ACE_ROOT)/include/makeinclude/macros.GNU
-include $(ACE_ROOT)/include/makeinclude/rules.common.GNU
-include $(ACE_ROOT)/include/makeinclude/rules.nonested.GNU
-include $(ACE_ROOT)/include/makeinclude/rules.bin.GNU
-include $(ACE_ROOT)/include/makeinclude/rules.local.GNU
diff --git a/examples/C++NPv2/Makefile.Reactor_Logging_Server b/examples/C++NPv2/Makefile.Reactor_Logging_Server
deleted file mode 100644
index e8983880c76..00000000000
--- a/examples/C++NPv2/Makefile.Reactor_Logging_Server
+++ /dev/null
@@ -1,33 +0,0 @@
-#----------------------------------------------------------------------------
-#
-# $Id$
-#
-# Makefile for C++NPv2 Reactor_Logging_Server example program, chapter 3.
-#----------------------------------------------------------------------------
-
-#----------------------------------------------------------------------------
-# Local macros
-#----------------------------------------------------------------------------
-
-BIN = Reactor_Logging_Server
-
-FILES = Logging_Acceptor \
- Logging_Event_Handler \
- Logging_Event_Handler_Ex \
- Logging_Handler
-
-SRC = $(addsuffix .cpp,$(FILES))
-OBJ = $(addsuffix .o,$(FILES))
-
-BUILD = $(VBIN)
-
-#----------------------------------------------------------------------------
-# Include macros and targets
-#----------------------------------------------------------------------------
-
-include $(ACE_ROOT)/include/makeinclude/wrapper_macros.GNU
-include $(ACE_ROOT)/include/makeinclude/macros.GNU
-include $(ACE_ROOT)/include/makeinclude/rules.common.GNU
-include $(ACE_ROOT)/include/makeinclude/rules.nonested.GNU
-include $(ACE_ROOT)/include/makeinclude/rules.bin.GNU
-include $(ACE_ROOT)/include/makeinclude/rules.local.GNU
diff --git a/examples/C++NPv2/Makefile.SLD b/examples/C++NPv2/Makefile.SLD
deleted file mode 100644
index 7f610f1bb55..00000000000
--- a/examples/C++NPv2/Makefile.SLD
+++ /dev/null
@@ -1,41 +0,0 @@
-#----------------------------------------------------------------------------
-# $Id$
-#
-# Makefile for the SLD library in the C++NPv2, Chapter 5 example.
-#----------------------------------------------------------------------------
-
-#----------------------------------------------------------------------------
-# Local macros
-#----------------------------------------------------------------------------
-
-SHLIB = libSLD.$(SOEXT)
-FILES = SLD \
- Logging_Acceptor \
- Logging_Event_Handler \
- Logging_Handler
-LSRC = $(addsuffix .cpp,$(FILES))
-
-LIBS += $(ACELIB)
-
-BUILD = $(VSHLIB)
-
-#----------------------------------------------------------------------------
-# Include macros and targets
-#----------------------------------------------------------------------------
-
-include $(ACE_ROOT)/include/makeinclude/wrapper_macros.GNU
-include $(ACE_ROOT)/include/makeinclude/macros.GNU
-include $(ACE_ROOT)/include/makeinclude/rules.common.GNU
-include $(ACE_ROOT)/include/makeinclude/rules.nonested.GNU
-include $(ACE_ROOT)/include/makeinclude/rules.lib.GNU
-include $(ACE_ROOT)/include/makeinclude/rules.local.GNU
-
-#----------------------------------------------------------------------------
-# Local targets
-#----------------------------------------------------------------------------
-
-ifeq ($(shared_libs),1)
-ifneq ($(SHLIB),)
-CPPFLAGS += -DSLD_BUILD_DLL
-endif
-endif
diff --git a/examples/C++NPv2/Makefile.SLDex b/examples/C++NPv2/Makefile.SLDex
deleted file mode 100644
index d7786849091..00000000000
--- a/examples/C++NPv2/Makefile.SLDex
+++ /dev/null
@@ -1,43 +0,0 @@
-#----------------------------------------------------------------------------
-# $Id$
-#
-# Makefile for the SLDex library in the C++NPv2, Chapter 5 example.
-#----------------------------------------------------------------------------
-
-#----------------------------------------------------------------------------
-# Local macros
-#----------------------------------------------------------------------------
-
-SHLIB = libSLDex.$(SOEXT)
-FILES = SLDex \
- Logging_Acceptor \
- Logging_Event_Handler \
- Logging_Event_Handler_Ex \
- Logging_Handler \
- Server_Shutdown
-LSRC = $(addsuffix .cpp,$(FILES))
-
-LIBS += $(ACELIB)
-
-BUILD = $(VSHLIB)
-
-#----------------------------------------------------------------------------
-# Include macros and targets
-#----------------------------------------------------------------------------
-
-include $(ACE_ROOT)/include/makeinclude/wrapper_macros.GNU
-include $(ACE_ROOT)/include/makeinclude/macros.GNU
-include $(ACE_ROOT)/include/makeinclude/rules.common.GNU
-include $(ACE_ROOT)/include/makeinclude/rules.nonested.GNU
-include $(ACE_ROOT)/include/makeinclude/rules.lib.GNU
-include $(ACE_ROOT)/include/makeinclude/rules.local.GNU
-
-#----------------------------------------------------------------------------
-# Local targets
-#----------------------------------------------------------------------------
-
-ifeq ($(shared_libs),1)
-ifneq ($(SHLIB),)
-CPPFLAGS += -DSLDEX_BUILD_DLL
-endif
-endif
diff --git a/examples/C++NPv2/Makefile.SR_Configurable_Logging_Server b/examples/C++NPv2/Makefile.SR_Configurable_Logging_Server
deleted file mode 100644
index dbef57cc25b..00000000000
--- a/examples/C++NPv2/Makefile.SR_Configurable_Logging_Server
+++ /dev/null
@@ -1,29 +0,0 @@
-#----------------------------------------------------------------------------
-#
-# $Id$
-#
-# Makefile for C++NPv2 SR_Configurable_Logging_Server example program,
-# chapter 7.
-#----------------------------------------------------------------------------
-
-#----------------------------------------------------------------------------
-# Local macros
-#----------------------------------------------------------------------------
-
-BIN = SR_Configurable_Logging_Server
-
-SRC = $(addsuffix .cpp,$(FILES))
-OBJ = $(addsuffix .o,$(FILES))
-
-BUILD = $(VBIN)
-
-#----------------------------------------------------------------------------
-# Include macros and targets
-#----------------------------------------------------------------------------
-
-include $(ACE_ROOT)/include/makeinclude/wrapper_macros.GNU
-include $(ACE_ROOT)/include/makeinclude/macros.GNU
-include $(ACE_ROOT)/include/makeinclude/rules.common.GNU
-include $(ACE_ROOT)/include/makeinclude/rules.nonested.GNU
-include $(ACE_ROOT)/include/makeinclude/rules.bin.GNU
-include $(ACE_ROOT)/include/makeinclude/rules.local.GNU
diff --git a/examples/C++NPv2/Makefile.Select_Reactor_Logging_Server b/examples/C++NPv2/Makefile.Select_Reactor_Logging_Server
deleted file mode 100644
index 892e0869dac..00000000000
--- a/examples/C++NPv2/Makefile.Select_Reactor_Logging_Server
+++ /dev/null
@@ -1,34 +0,0 @@
-#----------------------------------------------------------------------------
-#
-# $Id$
-#
-# Makefile for C++NPv2 Select_Reactor_Logging_Server example program,
-# chapter 4.
-#----------------------------------------------------------------------------
-
-#----------------------------------------------------------------------------
-# Local macros
-#----------------------------------------------------------------------------
-
-BIN = Select_Reactor_Logging_Server
-
-FILES = Logging_Acceptor \
- Logging_Event_Handler \
- Logging_Event_Handler_Ex \
- Logging_Handler
-
-SRC = $(addsuffix .cpp,$(FILES))
-OBJ = $(addsuffix .o,$(FILES))
-
-BUILD = $(VBIN)
-
-#----------------------------------------------------------------------------
-# Include macros and targets
-#----------------------------------------------------------------------------
-
-include $(ACE_ROOT)/include/makeinclude/wrapper_macros.GNU
-include $(ACE_ROOT)/include/makeinclude/macros.GNU
-include $(ACE_ROOT)/include/makeinclude/rules.common.GNU
-include $(ACE_ROOT)/include/makeinclude/rules.nonested.GNU
-include $(ACE_ROOT)/include/makeinclude/rules.bin.GNU
-include $(ACE_ROOT)/include/makeinclude/rules.local.GNU
diff --git a/examples/C++NPv2/Makefile.TPCLS b/examples/C++NPv2/Makefile.TPCLS
deleted file mode 100644
index 08465b55e3e..00000000000
--- a/examples/C++NPv2/Makefile.TPCLS
+++ /dev/null
@@ -1,58 +0,0 @@
-#----------------------------------------------------------------------------
-# $Id$
-#
-# Makefile for the TPCLS library in the C++NPv2, Chapter 7 example.
-#----------------------------------------------------------------------------
-
-#----------------------------------------------------------------------------
-# Local macros
-#----------------------------------------------------------------------------
-
-# This example uses SSL.
-ifeq ($(ssl),)
-default:
- @echo 'This example requires SSL; build with make ssl=1'
-endif #ssl
-
-SHLIB = libTPCLS.$(SOEXT)
-FILES = TPC_Logging_Server \
- Logging_Handler
-LSRC = $(addsuffix .cpp,$(FILES))
-
-LIBS += $(ACELIB)
-
-BUILD = $(VSHLIB)
-
-#----------------------------------------------------------------------------
-# Include macros and targets
-#----------------------------------------------------------------------------
-
-include $(ACE_ROOT)/include/makeinclude/wrapper_macros.GNU
-include $(ACE_ROOT)/include/makeinclude/macros.GNU
-include $(ACE_ROOT)/include/makeinclude/rules.common.GNU
-include $(ACE_ROOT)/include/makeinclude/rules.nonested.GNU
-include $(ACE_ROOT)/include/makeinclude/rules.lib.GNU
-include $(ACE_ROOT)/include/makeinclude/rules.local.GNU
-
-#----------------------------------------------------------------------------
-# Local targets
-#----------------------------------------------------------------------------
-
-# To remake the DLL_Test source with xlC on AIX, it works
-# best to wipe out any previously-created tempinc directory.
-# The compiler/linker isn't too smart about instantiating templates...
-ifdef TEMPINCDIR
-COMPILE.cc := $(RM) -rf tempinc; $(COMPILE.cc)
-endif
-
-ifneq ($(ssl),)
- CPPFLAGS += $(PLATFORM_SSL_CPPFLAGS)
- LIBS += $(PLATFORM_SSL_LIBS)
- LDFLAGS += $(PLATFORM_SSL_LDFLAGS)
-endif # ssl
-
-ifeq ($(shared_libs),1)
-ifneq ($(SHLIB),)
-CPPFLAGS += -DTPCLS_BUILD_DLL
-endif
-endif
diff --git a/examples/C++NPv2/Makefile.TPLS b/examples/C++NPv2/Makefile.TPLS
deleted file mode 100644
index 1ddc1779d72..00000000000
--- a/examples/C++NPv2/Makefile.TPLS
+++ /dev/null
@@ -1,41 +0,0 @@
-#----------------------------------------------------------------------------
-# $Id$
-#
-# Makefile for the TPLS library in the C++NPv2, Chapter 6 example.
-#----------------------------------------------------------------------------
-
-#----------------------------------------------------------------------------
-# Local macros
-#----------------------------------------------------------------------------
-
-SHLIB = libTPLS.$(SOEXT)
-FILES = TP_Logging_Server \
- Logging_Acceptor \
- Logging_Event_Handler \
- Logging_Handler
-LSRC = $(addsuffix .cpp,$(FILES))
-
-LIBS += $(ACELIB)
-
-BUILD = $(VSHLIB)
-
-#----------------------------------------------------------------------------
-# Include macros and targets
-#----------------------------------------------------------------------------
-
-include $(ACE_ROOT)/include/makeinclude/wrapper_macros.GNU
-include $(ACE_ROOT)/include/makeinclude/macros.GNU
-include $(ACE_ROOT)/include/makeinclude/rules.common.GNU
-include $(ACE_ROOT)/include/makeinclude/rules.nonested.GNU
-include $(ACE_ROOT)/include/makeinclude/rules.lib.GNU
-include $(ACE_ROOT)/include/makeinclude/rules.local.GNU
-
-#----------------------------------------------------------------------------
-# Local targets
-#----------------------------------------------------------------------------
-
-ifeq ($(shared_libs),1)
-ifneq ($(SHLIB),)
-CPPFLAGS += -DTPLS_BUILD_DLL
-endif
-endif
diff --git a/examples/C++NPv2/Makefile.TP_Reactor_Logging_Server b/examples/C++NPv2/Makefile.TP_Reactor_Logging_Server
deleted file mode 100644
index ee6912b2d53..00000000000
--- a/examples/C++NPv2/Makefile.TP_Reactor_Logging_Server
+++ /dev/null
@@ -1,34 +0,0 @@
-#----------------------------------------------------------------------------
-#
-# $Id$
-#
-# Makefile for C++NPv2 TP_Reactor_Logging_Server example program,
-# chapter 4.
-#----------------------------------------------------------------------------
-
-#----------------------------------------------------------------------------
-# Local macros
-#----------------------------------------------------------------------------
-
-BIN = TP_Reactor_Logging_Server
-
-FILES = Logging_Acceptor \
- Logging_Event_Handler \
- Logging_Event_Handler_Ex \
- Logging_Handler
-
-SRC = $(addsuffix .cpp,$(FILES))
-OBJ = $(addsuffix .o,$(FILES))
-
-BUILD = $(VBIN)
-
-#----------------------------------------------------------------------------
-# Include macros and targets
-#----------------------------------------------------------------------------
-
-include $(ACE_ROOT)/include/makeinclude/wrapper_macros.GNU
-include $(ACE_ROOT)/include/makeinclude/macros.GNU
-include $(ACE_ROOT)/include/makeinclude/rules.common.GNU
-include $(ACE_ROOT)/include/makeinclude/rules.nonested.GNU
-include $(ACE_ROOT)/include/makeinclude/rules.bin.GNU
-include $(ACE_ROOT)/include/makeinclude/rules.local.GNU
diff --git a/examples/C++NPv2/Makefile.display_logfile b/examples/C++NPv2/Makefile.display_logfile
deleted file mode 100644
index 78041b910fd..00000000000
--- a/examples/C++NPv2/Makefile.display_logfile
+++ /dev/null
@@ -1,32 +0,0 @@
-#----------------------------------------------------------------------------
-#
-# $Id$
-#
-# Makefile for C++NPv2 example programs.
-#----------------------------------------------------------------------------
-
-#----------------------------------------------------------------------------
-# Local macros
-#----------------------------------------------------------------------------
-
-BIN = display_logfile
-
-#FILES = CCM_App
-#SHLIB = libCCM_App.$(SOEXT)
-
-#LSRC = $(addsuffix .cpp,$(FILES))
-#LOBJ = $(addsuffix .o,$(FILES))
-#SHOBJ = $(addsuffix .so,$(FILES))
-
-BUILD = $(VBIN)
-
-#----------------------------------------------------------------------------
-# Include macros and targets
-#----------------------------------------------------------------------------
-
-include $(ACE_ROOT)/include/makeinclude/wrapper_macros.GNU
-include $(ACE_ROOT)/include/makeinclude/macros.GNU
-include $(ACE_ROOT)/include/makeinclude/rules.common.GNU
-include $(ACE_ROOT)/include/makeinclude/rules.nonested.GNU
-include $(ACE_ROOT)/include/makeinclude/rules.bin.GNU
-include $(ACE_ROOT)/include/makeinclude/rules.local.GNU
diff --git a/examples/C++NPv2/README b/examples/C++NPv2/README
deleted file mode 100644
index 58a1f31a728..00000000000
--- a/examples/C++NPv2/README
+++ /dev/null
@@ -1,99 +0,0 @@
-(This is file $Id$)
-
-The files in this directory contain the source code from the book
-``C++ Network Programming: Systematic Reuse with ACE and Frameworks''
-(C++NPv2) by Douglas C. Schmidt and Stephen D. Huston (Addison-Wesley
-2001, ISBN 0-201-79525-6).
-
-We have compiled and run these files on the following platforms:
-
- Sun Solaris 8 on SPARC using Sun Forte 6.
- Redhat Linux 7.1 using g++ 2.96.
- Microsoft Windows 2000 using Microsoft Visual C++ 6.
-
-You must have the ACE_ROOT environment variable set correctly to build
-these examples. ACE_ROOT must refer to the top-level ACE_wrappers
-directory. Please see $ACE_ROOT/ACE-INSTALL.html for instructions on
-how to build the ACE toolkit.
-
-Mapping Source Files to Book Chapters
--------------------------------------
-
-The files in this directory map to the chapters in C++NPv2 as follows:
-
-Chapter 3 Logging_Acceptor.cpp
- Logging_Acceptor.h
- Logging_Acceptor_Ex.h
- Logging_Event_Handler.cpp
- Logging_Event_Handler.h
- Logging_Event_Handler_Ex.cpp
- Logging_Event_Handler_Ex.h
- Logging_Handler.cpp
- Logging_Handler.h
- Reactor_Logging_Server.cpp
- Reactor_Logging_Server.h
- Reactor_Logging_Server_T.cpp
-
-Chapter 4 Select_Reactor_Logging_Server.cpp
- TP_Reactor_Logging_Server.cpp
- WFMO_Reactor_Logging_Server.cpp
-
-Chapter 5 Configurable_Logging_Server.cpp
- Reactor_Logging_Server_Adapter.cpp
- Reactor_Logging_Server_Adapter.h
- Service_Reporter.cpp
- Service_Reporter.h
- Server_Shutdown.cpp
- SLD.cpp
- SLDEX_export.h
- SLD_export.h
- SLDex.cpp
-
-Chapter 6 Client_Logging_Daemon.cpp
- CLD_export.h
- TPLS_export.h
- TP_Logging_Server.cpp
- TP_Logging_Server.h
-
-Chapter 7 AC_CLD_export.h
- AC_Client_Logging_Daemon.cpp
- SR_Configurable_Logging_Server.cpp
- TPC_Logging_Server.cpp
- TPC_Logging_Server.h
- TPCLS_export.h
-
-Chapter 8 AIO_CLD_export.h
- AIO_Client_Logging_Daemon.cpp
-
-Chapter 9 display_logfile.cpp
-
-Microsoft Visual C++ users:
----------------------------
-
-The examples.dsw file is a Microsoft Visual C++ workspace file that
-contains projects for the individual programs. You can either build
-them separately, or use the Batch Build command to build multiple
-projects at once.
-
-All other users:
-----------------
-
-Assuming that your system is configured correctly, you should be able
-to type
-
-% make
-
-to compile all of the programs, and
-
-% make clean
-
-to remove all the files that were generated during compilation.
-
-There are also individual Makefiles for each separate example program.
-These makefiles have a ".mak" suffix. For example, display_logfile.mak
-is the makefile for the display_logfile program.
-
-All of the files in these directories are copyright Addison Wesley,
-and they come with absolutely no warranty whatsoever. Permission is
-hereby granted to use these programs for educational or commercial
-purposes.
diff --git a/examples/C++NPv2/Reactor_Logging_Server.cpp b/examples/C++NPv2/Reactor_Logging_Server.cpp
deleted file mode 100644
index c6c16d631c8..00000000000
--- a/examples/C++NPv2/Reactor_Logging_Server.cpp
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
-** $Id$
-**
-** Copyright 2002 Addison Wesley. All Rights Reserved.
-*/
-
-#include "Reactor_Logging_Server.h"
-#include "Logging_Acceptor_Ex.h"
-#include "ace/Log_Msg.h"
-
-typedef Reactor_Logging_Server<Logging_Acceptor_Ex>
- Server_Logging_Daemon;
-
-int main (int argc, char *argv[])
-{
- ACE_Reactor reactor;
- Server_Logging_Daemon *server;
- // Ignore argv[0]...
- --argc; ++argv;
- ACE_NEW_RETURN (server,
- Server_Logging_Daemon (argc, argv, &reactor),
- 1);
-
- if (reactor.run_reactor_event_loop () == -1)
- ACE_ERROR_RETURN ((LM_ERROR, "%p\n",
- "run_reactor_event_loop()"), 1);
- return 0;
-}
-
-#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION)
-template class Reactor_Logging_Server<Logging_Acceptor_Ex>;
-#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA)
-#pragma instantiate Reactor_Logging_Server<Logging_Acceptor_Ex>
-#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */
diff --git a/examples/C++NPv2/Reactor_Logging_Server.dsp b/examples/C++NPv2/Reactor_Logging_Server.dsp
deleted file mode 100644
index 5ff74c65433..00000000000
--- a/examples/C++NPv2/Reactor_Logging_Server.dsp
+++ /dev/null
@@ -1,144 +0,0 @@
-# Microsoft Developer Studio Project File - Name="Reactor_Logging_Server" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=Reactor_Logging_Server - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "Reactor_Logging_Server.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "Reactor_Logging_Server.mak" CFG="Reactor_Logging_Server - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "Reactor_Logging_Server - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "Reactor_Logging_Server - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "Reactor_Logging_Server - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c
-# SUBTRACT CPP /YX
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 ace.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\ace"
-
-!ELSEIF "$(CFG)" == "Reactor_Logging_Server - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Reactor_Logging_Server___Win32_Debug"
-# PROP BASE Intermediate_Dir "Reactor_Logging_Server___Win32_Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\.." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c
-# SUBTRACT CPP /YX
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 aced.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\ace"
-
-!ENDIF
-
-# Begin Target
-
-# Name "Reactor_Logging_Server - Win32 Release"
-# Name "Reactor_Logging_Server - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\Logging_Acceptor.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\Logging_Event_Handler.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\Logging_Event_Handler_Ex.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\Logging_Handler.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\Reactor_Logging_Server.cpp
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\Logging_Acceptor.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\Logging_Acceptor_Ex.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\Logging_Event_Handler.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\Logging_Event_Handler_Ex.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\Logging_Handler.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\Reactor_Logging_Server.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/examples/C++NPv2/Reactor_Logging_Server.h b/examples/C++NPv2/Reactor_Logging_Server.h
deleted file mode 100644
index 6b50860892b..00000000000
--- a/examples/C++NPv2/Reactor_Logging_Server.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
-** $Id$
-**
-** Copyright 2002 Addison Wesley. All Rights Reserved.
-*/
-
-#ifndef _REACTOR_LOGGING_SERVER_H
-#define _REACTOR_LOGGING_SERVER_H
-
-#include "ace/ACE.h"
-#include "ace/Reactor.h"
-
-template <class ACCEPTOR>
-class Reactor_Logging_Server : public ACCEPTOR
-{
-public:
- Reactor_Logging_Server (int argc, char *argv[],
- ACE_Reactor *reactor);
-};
-
-#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
-#include "Reactor_Logging_Server_T.cpp"
-#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
-
-#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
-#pragma implementation ("Reactor_Logging_Server_T.cpp")
-#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
-
-#endif /* _REACTOR_LOGGING_SERVER_H */
diff --git a/examples/C++NPv2/Reactor_Logging_Server_Adapter.cpp b/examples/C++NPv2/Reactor_Logging_Server_Adapter.cpp
deleted file mode 100644
index 1a5c8c11cae..00000000000
--- a/examples/C++NPv2/Reactor_Logging_Server_Adapter.cpp
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
-** $Id$
-**
-** Copyright 2002 Addison Wesley. All Rights Reserved.
-*/
-
-#ifndef _REACTOR_LOGGING_SERVER_ADAPTER_C
-#define _REACTOR_LOGGING_SERVER_ADAPTER_C
-
-#include "ace/ACE.h"
-#include "ace/Auto_Ptr.h"
-#include "ace/INET_Addr.h"
-#include "Reactor_Logging_Server_Adapter.h"
-
-template <class ACCEPTOR> int
-Reactor_Logging_Server_Adapter<ACCEPTOR>::init (int argc,
- ACE_TCHAR *argv[]) {
- int i;
- char **array = 0;
- ACE_NEW_RETURN (array, char*[argc], -1);
- ACE_Auto_Array_Ptr<char *> char_argv (array);
-
- for (i = 0; i < argc; ++i)
- char_argv[i] = ACE::strnew (ACE_TEXT_ALWAYS_CHAR (argv[i]));
- ACE_NEW_NORETURN (server_, Reactor_Logging_Server<ACCEPTOR>
- (i, char_argv.get (),
- ACE_Reactor::instance ()));
- for (i = 0; i < argc; ++i) ACE::strdelete (char_argv[i]);
- return server_ == 0 ? -1 : 0;
-}
-
-
-template <class ACCEPTOR> int
-Reactor_Logging_Server_Adapter<ACCEPTOR>::fini ()
-{ server_->handle_close (); server_ = 0; return 0; }
-
-
-template <class ACCEPTOR> int
-Reactor_Logging_Server_Adapter<ACCEPTOR>::info
- (ACE_TCHAR **bufferp, size_t length) const {
- ACE_INET_Addr local_addr;
- server_->acceptor ().get_local_addr (local_addr);
-
- ACE_TCHAR buf[BUFSIZ];
- ACE_OS::sprintf (buf,
- ACE_TEXT ("%hu"),
- local_addr.get_port_number ());
- ACE_OS_String::strcat
- (buf, ACE_TEXT ("/tcp # Reactor-based logging server\n"));
- if (*bufferp == 0)
- *bufferp = ACE::strnew (buf);
- else
- ACE_OS_String::strncpy (*bufferp, buf, length);
- return ACE_OS_String::strlen (*bufferp);
-}
-
-
-template <class ACCEPTOR> int
-Reactor_Logging_Server_Adapter<ACCEPTOR>::suspend ()
-{ return server_->reactor ()->suspend_handler (server_); }
-
-
-template <class ACCEPTOR> int
-Reactor_Logging_Server_Adapter<ACCEPTOR>::resume ()
-{ return server_->reactor ()->resume_handler (server_); }
-
-#endif /* _REACTOR_LOGGING_SERVER_ADAPTER_C */
diff --git a/examples/C++NPv2/Reactor_Logging_Server_Adapter.h b/examples/C++NPv2/Reactor_Logging_Server_Adapter.h
deleted file mode 100644
index 181d35a8b7d..00000000000
--- a/examples/C++NPv2/Reactor_Logging_Server_Adapter.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
-** $Id$
-**
-** Copyright 2002 Addison Wesley. All Rights Reserved.
-*/
-
-#ifndef _REACTOR_LOGGING_SERVER_ADAPTER_H
-#define _REACTOR_LOGGING_SERVER_ADAPTER_H
-
-#include "ace/Service_Object.h"
-#include "Reactor_Logging_Server.h"
-
-template <class ACCEPTOR>
-class Reactor_Logging_Server_Adapter : public ACE_Service_Object {
-public:
- // Hook methods inherited from <ACE_Service_Object>.
- virtual int init (int argc, ACE_TCHAR *argv[]);
- virtual int fini ();
- virtual int info (ACE_TCHAR **, size_t) const;
- virtual int suspend ();
- virtual int resume ();
-
-private:
- Reactor_Logging_Server<ACCEPTOR> *server_;
-};
-
-#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
-#include "Reactor_Logging_Server_Adapter.cpp"
-#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
-
-#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
-#pragma implementation ("Reactor_Logging_Server_Adapter.cpp")
-#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
-
-#endif /* _REACTOR_LOGGING_SERVER_ADAPTER_H */
diff --git a/examples/C++NPv2/Reactor_Logging_Server_T.cpp b/examples/C++NPv2/Reactor_Logging_Server_T.cpp
deleted file mode 100644
index 3e25be39373..00000000000
--- a/examples/C++NPv2/Reactor_Logging_Server_T.cpp
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
-** $Id$
-**
-** Copyright 2002 Addison Wesley. All Rights Reserved.
-*/
-
-// Implementations for Reactor_Logging_Server<>
-
-template <class ACCEPTOR>
-Reactor_Logging_Server<ACCEPTOR>::Reactor_Logging_Server
- (int argc, char *argv[], ACE_Reactor *reactor)
- : ACCEPTOR (reactor) {
- u_short logger_port = argc > 0 ? atoi (argv[0]) : 0;
- ACE_TYPENAME ACCEPTOR::PEER_ADDR server_addr;
- int result;
-
- if (logger_port != 0)
- result = server_addr.set (logger_port,
- (ACE_UINT32) INADDR_ANY);
- else
- result = server_addr.set ("ace_logger",
- (ACE_UINT32) INADDR_ANY);
- if (result != -1)
- result = ACCEPTOR::open (server_addr);
- if (result == -1) reactor->end_reactor_event_loop ();
-}
diff --git a/examples/C++NPv2/SLD.cpp b/examples/C++NPv2/SLD.cpp
deleted file mode 100644
index abea1c1dad4..00000000000
--- a/examples/C++NPv2/SLD.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
-** $Id$
-**
-** Copyright 2002 Addison Wesley. All Rights Reserved.
-*/
-
-#include "ace/Log_Msg.h"
-
-#include "Reactor_Logging_Server_Adapter.h"
-#include "Logging_Acceptor.h"
-#include "SLD_export.h"
-
-typedef Reactor_Logging_Server_Adapter<Logging_Acceptor>
- Server_Logging_Daemon;
-
-ACE_FACTORY_DEFINE (SLD, Server_Logging_Daemon)
-
-#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION)
-template class Reactor_Logging_Server_Adapter<Logging_Acceptor>;
-#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA)
-#pragma instantiate Reactor_Logging_Server_Adapter<Logging_Acceptor>
-#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */
-
diff --git a/examples/C++NPv2/SLD.dsp b/examples/C++NPv2/SLD.dsp
deleted file mode 100644
index a89a7f32326..00000000000
--- a/examples/C++NPv2/SLD.dsp
+++ /dev/null
@@ -1,149 +0,0 @@
-# Microsoft Developer Studio Project File - Name="SLD" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=SLD - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "SLD.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "SLD.mak" CFG="SLD - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "SLD - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "SLD - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "SLD - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "SLD___Win32_Release"
-# PROP BASE Intermediate_Dir "SLD___Win32_Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SLD_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SLD_EXPORTS" /D "SLD_BUILD_DLL" /FD /c
-# SUBTRACT CPP /YX
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 ace.lib /nologo /dll /machine:I386 /libpath:"..\..\ace"
-
-!ELSEIF "$(CFG)" == "SLD - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "SLD___Win32_Debug"
-# PROP BASE Intermediate_Dir "SLD___Win32_Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SLD_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\.." /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SLD_EXPORTS" /D "SLD_BUILD_DLL" /FD /c
-# SUBTRACT CPP /YX
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 aced.lib /nologo /dll /debug /machine:I386 /out:"Debug/SLDd.dll" /pdbtype:sept /libpath:"..\..\ace"
-
-!ENDIF
-
-# Begin Target
-
-# Name "SLD - Win32 Release"
-# Name "SLD - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\Logging_Acceptor.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\Logging_Event_Handler.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\Logging_Handler.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\SLD.cpp
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\Logging_Acceptor.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\Logging_Event_Handler.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\Reactor_Logging_Server.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\Reactor_Logging_Server_Adapter.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\SLD_export.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# Begin Group "Template Files"
-
-# PROP Default_Filter "cpp"
-# Begin Source File
-
-SOURCE=.\Reactor_Logging_Server_Adapter.cpp
-# End Source File
-# End Group
-# End Target
-# End Project
diff --git a/examples/C++NPv2/SLDEX_export.h b/examples/C++NPv2/SLDEX_export.h
deleted file mode 100644
index 771c3335619..00000000000
--- a/examples/C++NPv2/SLDEX_export.h
+++ /dev/null
@@ -1,34 +0,0 @@
-
-// -*- C++ -*-
-// $Id$
-// Definition for Win32 Export directives.
-// This file is generated automatically by generate_export_file.pl SLDEX
-// ------------------------------
-#ifndef SLDEX_EXPORT_H
-#define SLDEX_EXPORT_H
-
-#include "ace/config-all.h"
-
-#if !defined (SLDEX_HAS_DLL)
-# define SLDEX_HAS_DLL 1
-#endif /* ! SLDEX_HAS_DLL */
-
-#if defined (SLDEX_HAS_DLL) && (SLDEX_HAS_DLL == 1)
-# if defined (SLDEX_BUILD_DLL)
-# define SLDEX_Export ACE_Proper_Export_Flag
-# define SLDEX_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
-# define SLDEX_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
-# else /* SLDEX_BUILD_DLL */
-# define SLDEX_Export ACE_Proper_Import_Flag
-# define SLDEX_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
-# define SLDEX_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
-# endif /* SLDEX_BUILD_DLL */
-#else /* SLDEX_HAS_DLL == 1 */
-# define SLDEX_Export
-# define SLDEX_SINGLETON_DECLARATION(T)
-# define SLDEX_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
-#endif /* SLDEX_HAS_DLL == 1 */
-
-#endif /* SLDEX_EXPORT_H */
-
-// End of auto generated file.
diff --git a/examples/C++NPv2/SLD_export.h b/examples/C++NPv2/SLD_export.h
deleted file mode 100644
index de4f39fc488..00000000000
--- a/examples/C++NPv2/SLD_export.h
+++ /dev/null
@@ -1,34 +0,0 @@
-
-// -*- C++ -*-
-// $Id$
-// Definition for Win32 Export directives.
-// This file is generated automatically by generate_export_file.pl SLD
-// ------------------------------
-#ifndef SLD_EXPORT_H
-#define SLD_EXPORT_H
-
-#include "ace/config-all.h"
-
-#if !defined (SLD_HAS_DLL)
-# define SLD_HAS_DLL 1
-#endif /* ! SLD_HAS_DLL */
-
-#if defined (SLD_HAS_DLL) && (SLD_HAS_DLL == 1)
-# if defined (SLD_BUILD_DLL)
-# define SLD_Export ACE_Proper_Export_Flag
-# define SLD_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
-# define SLD_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
-# else /* SLD_BUILD_DLL */
-# define SLD_Export ACE_Proper_Import_Flag
-# define SLD_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
-# define SLD_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
-# endif /* SLD_BUILD_DLL */
-#else /* SLD_HAS_DLL == 1 */
-# define SLD_Export
-# define SLD_SINGLETON_DECLARATION(T)
-# define SLD_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
-#endif /* SLD_HAS_DLL == 1 */
-
-#endif /* SLD_EXPORT_H */
-
-// End of auto generated file.
diff --git a/examples/C++NPv2/SLDex.cpp b/examples/C++NPv2/SLDex.cpp
deleted file mode 100644
index 1ce99f950da..00000000000
--- a/examples/C++NPv2/SLDex.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
-** $Id$
-**
-** Copyright 2002 Addison Wesley. All Rights Reserved.
-*/
-
-#include "ace/Log_Msg.h"
-
-#include "Reactor_Logging_Server_Adapter.h"
-#include "Logging_Acceptor_Ex.h"
-#include "SLDEX_export.h"
-
-typedef Reactor_Logging_Server_Adapter<Logging_Acceptor_Ex>
- Server_Logging_Daemon_Ex;
-
-ACE_FACTORY_DEFINE (SLDEX, Server_Logging_Daemon_Ex)
-
-#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION)
-template class Reactor_Logging_Server_Adapter<Logging_Acceptor_Ex>;
-#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA)
-#pragma instantiate Reactor_Logging_Server_Adapter<Logging_Acceptor_Ex>
-#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */
-
diff --git a/examples/C++NPv2/SLDex.dsp b/examples/C++NPv2/SLDex.dsp
deleted file mode 100644
index 12fd38827bb..00000000000
--- a/examples/C++NPv2/SLDex.dsp
+++ /dev/null
@@ -1,157 +0,0 @@
-# Microsoft Developer Studio Project File - Name="SLDex" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=SLDex - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "SLDex.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "SLDex.mak" CFG="SLDex - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "SLDex - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "SLDex - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "SLDex - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SLDEX_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SLDEX_EXPORTS" /D "SLDEX_BUILD_DLL" /FD /c
-# SUBTRACT CPP /YX
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 ace.lib /nologo /dll /machine:I386 /libpath:"..\..\ace"
-
-!ELSEIF "$(CFG)" == "SLDex - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SLDEX_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\.." /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SLDEX_EXPORTS" /D "SLDEX_BUILD_DLL" /FD /c
-# SUBTRACT CPP /YX
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 aced.lib /nologo /dll /debug /machine:I386 /out:"Debug/SLDexd.dll" /pdbtype:sept /libpath:"..\..\ace"
-
-!ENDIF
-
-# Begin Target
-
-# Name "SLDex - Win32 Release"
-# Name "SLDex - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\Logging_Acceptor.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\Logging_Event_Handler.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\Logging_Event_Handler_Ex.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\Logging_Handler.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\Reactor_Logging_Server_Adapter.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\Server_Shutdown.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\SLDex.cpp
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\Logging_Acceptor.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\Logging_Event_Handler.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\Logging_Event_Handler_Ex.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\Logging_Handler.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\Reactor_Logging_Server_Adapter.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\SLDEX_export.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/examples/C++NPv2/SR_Configurable_Logging_Server.cpp b/examples/C++NPv2/SR_Configurable_Logging_Server.cpp
deleted file mode 100644
index 4e8eb05e5e5..00000000000
--- a/examples/C++NPv2/SR_Configurable_Logging_Server.cpp
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
-** $Id$
-**
-** Copyright 2002 Addison Wesley. All Rights Reserved.
-*/
-
-#include "ace/OS.h"
-#include "ace/Reactor.h"
-#include "ace/Select_Reactor.h"
-#include "ace/Service_Config.h"
-
-
-int ACE_TMAIN (int argc, ACE_TCHAR *argv[]) {
- ACE_Select_Reactor *select_reactor;
- ACE_NEW_RETURN (select_reactor, ACE_Select_Reactor, 1);
- ACE_Reactor *reactor;
- ACE_NEW_RETURN (reactor, ACE_Reactor (select_reactor, 1), 1);
- ACE_Reactor::close_singleton ();
- ACE_Reactor::instance (reactor, 1);
-
- ACE_Service_Config::open (argc, argv);
-
- ACE_Reactor::instance ()->run_reactor_event_loop ();
- return 0;
-}
diff --git a/examples/C++NPv2/SR_Configurable_Logging_Server.dsp b/examples/C++NPv2/SR_Configurable_Logging_Server.dsp
deleted file mode 100644
index c4b01773db3..00000000000
--- a/examples/C++NPv2/SR_Configurable_Logging_Server.dsp
+++ /dev/null
@@ -1,104 +0,0 @@
-# Microsoft Developer Studio Project File - Name="SR_Configurable_Logging_Server" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=SR_Configurable_Logging_Server - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "SR_Configurable_Logging_Server.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "SR_Configurable_Logging_Server.mak" CFG="SR_Configurable_Logging_Server - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "SR_Configurable_Logging_Server - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "SR_Configurable_Logging_Server - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "SR_Configurable_Logging_Server - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c
-# SUBTRACT CPP /YX
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 ace.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\ace"
-
-!ELSEIF "$(CFG)" == "SR_Configurable_Logging_Server - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "SR_Configurable_Logging_Server___Win32_Debug"
-# PROP BASE Intermediate_Dir "SR_Configurable_Logging_Server___Win32_Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\.." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c
-# SUBTRACT CPP /YX
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 aced.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\ace"
-
-!ENDIF
-
-# Begin Target
-
-# Name "SR_Configurable_Logging_Server - Win32 Release"
-# Name "SR_Configurable_Logging_Server - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\SR_Configurable_Logging_Server.cpp
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/examples/C++NPv2/Select_Reactor_Logging_Server.cpp b/examples/C++NPv2/Select_Reactor_Logging_Server.cpp
deleted file mode 100644
index a7c80a3c4eb..00000000000
--- a/examples/C++NPv2/Select_Reactor_Logging_Server.cpp
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
-** $Id$
-**
-** Copyright 2002 Addison Wesley. All Rights Reserved.
-*/
-
-#include "ace/streams.h"
-#include "ace/Reactor.h"
-#include "ace/Select_Reactor.h"
-#include "ace/Thread_Manager.h"
-
-#if defined (ACE_WIN32) && (!defined (ACE_HAS_STANDARD_CPP_LIBRARY) || \
- (ACE_HAS_STANDARD_CPP_LIBRARY == 0))
-# include <stdio.h>
-#else
-# include <string>
-#endif
-
-#include "Reactor_Logging_Server.h"
-#include "Logging_Acceptor_Ex.h"
-
-typedef Reactor_Logging_Server<Logging_Acceptor_Ex>
- Server_Logging_Daemon;
-
-
-class Quit_Handler : public ACE_Event_Handler {
- friend class ace_dewarn_gplusplus;
-public:
- Quit_Handler (ACE_Reactor *r) : ACE_Event_Handler (r) {}
-
- virtual int handle_exception (ACE_HANDLE) {
- reactor ()->end_reactor_event_loop ();
- return -1; // Trigger call to handle_close() method.
- }
-
- virtual int handle_close (ACE_HANDLE, ACE_Reactor_Mask)
- { delete this; return 0; }
-
-private:
-
- // Private destructor ensures dynamic allocation.
- virtual ~Quit_Handler () {}
-};
-
-
-static ACE_THR_FUNC_RETURN event_loop (void *arg) {
- ACE_Reactor *reactor = ACE_static_cast (ACE_Reactor *, arg);
-
- reactor->owner (ACE_OS::thr_self ());
- reactor->run_reactor_event_loop ();
- return 0;
-}
-
-
-static ACE_THR_FUNC_RETURN controller (void *arg) {
- ACE_Reactor *reactor = ACE_static_cast (ACE_Reactor *, arg);
-
- Quit_Handler *quit_handler = 0;
- ACE_NEW_RETURN (quit_handler, Quit_Handler (reactor), 0);
-
-#if defined (ACE_WIN32) && (!defined (ACE_HAS_STANDARD_CPP_LIBRARY) || \
- (ACE_HAS_STANDARD_CPP_LIBRARY == 0))
- for (;;) {
- char user_input[80];
- gets (user_input);
- if (ACE_OS_String::strcmp (user_input, "quit") == 0) {
- reactor->notify (quit_handler);
- break;
- }
- }
-#else
- for (;;) {
- std::string user_input;
- std::getline (cin, user_input, '\n');
- if (user_input == "quit") {
- reactor->notify (quit_handler);
- break;
- }
- }
-#endif
-
- return 0;
-}
-
-
-int main (int argc, char *argv[])
-{
- ACE_Select_Reactor select_reactor;
- ACE_Reactor reactor (&select_reactor);
-
- Server_Logging_Daemon *server;
- // Ignore argv[0]...
- --argc; ++argv;
- ACE_NEW_RETURN (server,
- Server_Logging_Daemon (argc, argv, &reactor),
- 1);
- ACE_Thread_Manager::instance ()->spawn (event_loop, &reactor);
- ACE_Thread_Manager::instance ()->spawn (controller, &reactor);
- return ACE_Thread_Manager::instance ()->wait ();
-}
-
-#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION)
-template class Reactor_Logging_Server<Logging_Acceptor_Ex>;
-#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA)
-#pragma instantiate Reactor_Logging_Server<Logging_Acceptor_Ex>
-#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */
diff --git a/examples/C++NPv2/Select_Reactor_Logging_Server.dsp b/examples/C++NPv2/Select_Reactor_Logging_Server.dsp
deleted file mode 100644
index 48acac3e029..00000000000
--- a/examples/C++NPv2/Select_Reactor_Logging_Server.dsp
+++ /dev/null
@@ -1,144 +0,0 @@
-# Microsoft Developer Studio Project File - Name="Select_Reactor_Logging_Server" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=Select_Reactor_Logging_Server - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "Select_Reactor_Logging_Server.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "Select_Reactor_Logging_Server.mak" CFG="Select_Reactor_Logging_Server - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "Select_Reactor_Logging_Server - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "Select_Reactor_Logging_Server - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "Select_Reactor_Logging_Server - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c
-# SUBTRACT CPP /YX
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 ace.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\ace"
-
-!ELSEIF "$(CFG)" == "Select_Reactor_Logging_Server - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Select_Reactor_Logging_Server___Win32_Debug"
-# PROP BASE Intermediate_Dir "Select_Reactor_Logging_Server___Win32_Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\.." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c
-# SUBTRACT CPP /YX
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 aced.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\ace"
-
-!ENDIF
-
-# Begin Target
-
-# Name "Select_Reactor_Logging_Server - Win32 Release"
-# Name "Select_Reactor_Logging_Server - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\Logging_Acceptor.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\Logging_Event_Handler.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\Logging_Event_Handler_Ex.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\Logging_Handler.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\Select_Reactor_Logging_Server.cpp
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\Logging_Acceptor.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\Logging_Acceptor_Ex.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\Logging_Event_Handler.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\Logging_Event_Handler_Ex.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\Logging_Handler.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\Reactor_Logging_Server.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/examples/C++NPv2/Server_Shutdown.cpp b/examples/C++NPv2/Server_Shutdown.cpp
deleted file mode 100644
index 7aa53224ec0..00000000000
--- a/examples/C++NPv2/Server_Shutdown.cpp
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
-** $Id$
-**
-** Copyright 2002 Addison Wesley. All Rights Reserved.
-*/
-
-#include "ace/OS.h"
-#include "ace/Event_Handler.h"
-#include "ace/Reactor.h"
-#include "ace/Service_Object.h"
-#include "ace/Thread_Manager.h"
-#include "ace/streams.h"
-
-#if defined (ACE_WIN32) && (!defined (ACE_HAS_STANDARD_CPP_LIBRARY) || \
- (ACE_HAS_STANDARD_CPP_LIBRARY == 0))
-# include <stdio.h>
-#else
-# include <string>
-#endif
-
-#include "SLDEX_export.h"
-
-
-class Quit_Handler : public ACE_Event_Handler {
- friend class ace_dewarn_gplusplus;
-public:
- Quit_Handler (ACE_Reactor *r) : ACE_Event_Handler (r) {}
-
- virtual int handle_exception (ACE_HANDLE) {
- reactor ()->end_reactor_event_loop ();
- return -1; // Trigger call to handle_close() method.
- }
-
- virtual int handle_close (ACE_HANDLE, ACE_Reactor_Mask)
- { delete this; return 0; }
-
-private:
-
- // Private destructor ensures dynamic allocation.
- virtual ~Quit_Handler () {}
-};
-
-
-static ACE_THR_FUNC_RETURN controller (void *arg) {
- ACE_Reactor *reactor = ACE_static_cast (ACE_Reactor *, arg);
-
- Quit_Handler *quit_handler = 0;
- ACE_NEW_RETURN (quit_handler, Quit_Handler (reactor), 0);
-
-#if defined (ACE_WIN32) && (!defined (ACE_HAS_STANDARD_CPP_LIBRARY) || \
- (ACE_HAS_STANDARD_CPP_LIBRARY == 0))
- for (;;) {
- char user_input[80];
- gets (user_input);
- if (ACE_OS_String::strcmp (user_input, "quit") == 0) {
- reactor->notify (quit_handler);
- break;
- }
- }
-#else
- for (;;) {
- std::string user_input;
- std::getline (cin, user_input, '\n');
- if (user_input == "quit") {
- reactor->notify (quit_handler);
- break;
- }
- }
-#endif
-
- return 0;
-}
-
-
-class Server_Shutdown : public ACE_Service_Object {
-public:
- virtual int init (int, ACE_TCHAR *[]) {
- reactor_ = ACE_Reactor::instance ();
- return ACE_Thread_Manager::instance ()->spawn
- (controller, reactor_, THR_DETACHED);
- }
-
- virtual int fini () {
- Quit_Handler *quit_handler = 0;
- ACE_NEW_RETURN (quit_handler,
- Quit_Handler (reactor_), -1);
- return reactor_->notify (quit_handler);
- }
-
-private:
- ACE_Reactor *reactor_;
-};
-
-ACE_FACTORY_DEFINE (SLDEX, Server_Shutdown)
diff --git a/examples/C++NPv2/Service_Reporter.cpp b/examples/C++NPv2/Service_Reporter.cpp
deleted file mode 100644
index ba241ec67ea..00000000000
--- a/examples/C++NPv2/Service_Reporter.cpp
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
-** $Id$
-**
-** Copyright 2002 Addison Wesley. All Rights Reserved.
-*/
-
-#include "ace/OS.h"
-#include "ace/Get_Opt.h"
-#include "ace/INET_Addr.h"
-#include "ace/Log_Msg.h"
-#include "ace/Service_Config.h"
-#include "ace/Service_Repository.h"
-#include "ace/Service_Types.h"
-#include "ace/SOCK_Stream.h"
-#include "Service_Reporter.h"
-
-
-int Service_Reporter::init (int argc, ACE_TCHAR *argv[]) {
- ACE_INET_Addr local_addr (Service_Reporter::DEFAULT_PORT);
-
- // Start at argv[0].
- ACE_Get_Opt get_opt (argc, argv, ACE_TEXT ("p:"), 0);
- get_opt.long_option (ACE_TEXT ("port"),
- 'p',
- ACE_Get_Opt::ARG_REQUIRED);
-
- for (int c; (c = get_opt ()) != -1; )
- switch (c) {
- case 'p':
- local_addr.set_port_number
- (ACE_OS::atoi (get_opt.opt_arg ()));
- }
-
- acceptor_.open (local_addr);
- return reactor ()->register_handler
- (this,
- ACE_Event_Handler::ACCEPT_MASK);
-}
-
-
-int Service_Reporter::handle_input (ACE_HANDLE) {
- ACE_SOCK_Stream peer_stream;
- acceptor_.accept (peer_stream);
-
- ACE_Service_Repository_Iterator iterator
- (*ACE_Service_Repository::instance (), 0);
-
- for (const ACE_Service_Type *st;
- iterator.next (st) != 0;
- iterator.advance ()) {
- iovec iov[3];
- iov[0].iov_base = ACE_const_cast (char *, st->name ());
- iov[0].iov_len =
- ACE_OS_String::strlen (st->name ()) * sizeof (ACE_TCHAR);
- const ACE_TCHAR *state = st->active () ?
- ACE_TEXT (" (active) ") : ACE_TEXT (" (paused) ");
- iov[1].iov_base = ACE_const_cast (char *, state);
- iov[1].iov_len =
- ACE_OS_String::strlen (state) * sizeof (ACE_TCHAR);
- ACE_TCHAR *report = 0; // Ask info() to allocate buffer
- int len = st->type ()->info (&report, 0);
- iov[2].iov_base = ACE_static_cast (char *, report);
- iov[2].iov_len = ACE_static_cast (size_t, len);
- iov[2].iov_len *= sizeof (ACE_TCHAR);
- peer_stream.sendv_n (iov, 3);
- ACE::strdelete (report);
- }
-
- peer_stream.close ();
- return 0;
-}
-
-
-int Service_Reporter::info (ACE_TCHAR **bufferp,
- size_t length) const {
- ACE_INET_Addr local_addr;
- acceptor_.get_local_addr (local_addr);
-
- ACE_TCHAR buf[BUFSIZ];
- ACE_OS::sprintf
- (buf, ACE_TEXT ("%hu"), local_addr.get_port_number ());
- ACE_OS_String::strcat
- (buf, ACE_TEXT ("/tcp # lists services in daemon\n"));
- if (*bufferp == 0)
- *bufferp = ACE::strnew (buf);
- else
- ACE_OS_String::strncpy (*bufferp, buf, length);
- return ACE_OS_String::strlen (*bufferp);
-}
-
-
-int Service_Reporter::suspend ()
-{ return reactor ()->suspend_handler (this); }
-
-int Service_Reporter::resume ()
-{ return reactor ()->resume_handler (this); }
-
-
-int Service_Reporter::fini () {
- reactor ()->remove_handler
- (this,
- ACE_Event_Handler::ACCEPT_MASK
- | ACE_Event_Handler::DONT_CALL);
- return acceptor_.close ();
-}
-
-// Define the service object make and gobble functions.
-ACE_FACTORY_DEFINE (ACE_Local_Service, Service_Reporter)
-
-// Define the ACE_Static_Svc_Descriptor that conveys the service information
-// to the ACE_Service_Config.
-ACE_STATIC_SVC_DEFINE (
- Reporter_Descriptor,
- ACE_TEXT ("Service_Reporter"),
- ACE_SVC_OBJ_T,
- &ACE_SVC_NAME (Service_Reporter),
- ACE_Service_Type::DELETE_THIS
- | ACE_Service_Type::DELETE_OBJ,
- 0 // This object is not initially active.
-)
-
-// Define the class that will register this service with ACE_Service_Config
-// at program startup.
-ACE_STATIC_SVC_REQUIRE (Reporter_Descriptor)
diff --git a/examples/C++NPv2/Service_Reporter.h b/examples/C++NPv2/Service_Reporter.h
deleted file mode 100644
index c6de7484767..00000000000
--- a/examples/C++NPv2/Service_Reporter.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
-** $Id$
-**
-** Copyright 2002 Addison Wesley. All Rights Reserved.
-*/
-
-#ifndef _SERVICE_REPORTER_H
-#define _SERVICE_REPORTER_H
-
-#include "ace/Reactor.h"
-#include "ace/Service_Object.h"
-#include "ace/SOCK_Acceptor.h"
-
-
-class Service_Reporter : public ACE_Service_Object {
-public:
- Service_Reporter (ACE_Reactor *r = ACE_Reactor::instance ())
- : ACE_Service_Object (r) {}
-
-protected:
- // Hook methods inherited from <ACE_Service_Object>.
- virtual int init (int argc, ACE_TCHAR *argv[]);
- virtual int fini ();
- virtual int info (ACE_TCHAR **, size_t) const;
- virtual int suspend ();
- virtual int resume ();
-
- // Reactor hook methods.
- virtual int handle_input (ACE_HANDLE);
- virtual ACE_HANDLE get_handle () const
- { return acceptor_.get_handle (); }
-
-private:
- ACE_SOCK_Acceptor acceptor_; // Acceptor instance.
- enum { DEFAULT_PORT = 9411 };
-};
-
-#endif /* _SERVICE_REPORTER_H */
diff --git a/examples/C++NPv2/TPCLS.dsp b/examples/C++NPv2/TPCLS.dsp
deleted file mode 100644
index 433c54d9ed6..00000000000
--- a/examples/C++NPv2/TPCLS.dsp
+++ /dev/null
@@ -1,129 +0,0 @@
-# Microsoft Developer Studio Project File - Name="TPCLS" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=TPCLS - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "TPCLS.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "TPCLS.mak" CFG="TPCLS - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "TPCLS - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "TPCLS - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "TPCLS - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "TPCLS___Win32_Release"
-# PROP BASE Intermediate_Dir "TPCLS___Win32_Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "TPCLS_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "TPCLS_EXPORTS" /D "TPCLS_BUILD_DLL" /FD /c
-# SUBTRACT CPP /YX
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 ace.lib libeay32.lib ssleay32.lib /nologo /dll /machine:I386 /libpath:"..\..\ace"
-
-!ELSEIF "$(CFG)" == "TPCLS - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "TPCLS___Win32_Debug"
-# PROP BASE Intermediate_Dir "TPCLS___Win32_Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "TPCLS_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\.." /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "TPCLS_EXPORTS" /D "TPCLS_BUILD_DLL" /FD /c
-# SUBTRACT CPP /YX
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 aced.lib libeay32.lib ssleay32.lib /nologo /dll /debug /machine:I386 /out:"Debug/TPCLSd.dll" /pdbtype:sept /libpath:"..\..\ace"
-
-!ENDIF
-
-# Begin Target
-
-# Name "TPCLS - Win32 Release"
-# Name "TPCLS - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\Logging_Handler.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\TPC_Logging_Server.cpp
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\TPC_Logging_Server.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\TPCLS_export.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# Begin Group "Template Files"
-
-# PROP Default_Filter "cpp"
-# Begin Source File
-
-SOURCE=.\Reactor_Logging_Server_Adapter.cpp
-# End Source File
-# End Group
-# End Target
-# End Project
diff --git a/examples/C++NPv2/TPCLS_export.h b/examples/C++NPv2/TPCLS_export.h
deleted file mode 100644
index 71039b40aa7..00000000000
--- a/examples/C++NPv2/TPCLS_export.h
+++ /dev/null
@@ -1,50 +0,0 @@
-
-// -*- C++ -*-
-// $Id$
-// Definition for Win32 Export directives.
-// This file is generated automatically by generate_export_file.pl TPCLS
-// ------------------------------
-#ifndef TPCLS_EXPORT_H
-#define TPCLS_EXPORT_H
-
-#include "ace/config-all.h"
-
-#if !defined (TPCLS_HAS_DLL)
-# define TPCLS_HAS_DLL 1
-#endif /* ! TPCLS_HAS_DLL */
-
-#if defined (TPCLS_HAS_DLL) && (TPCLS_HAS_DLL == 1)
-# if defined (TPCLS_BUILD_DLL)
-# define TPCLS_Export ACE_Proper_Export_Flag
-# define TPCLS_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
-# define TPCLS_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
-# else /* TPCLS_BUILD_DLL */
-# define TPCLS_Export ACE_Proper_Import_Flag
-# define TPCLS_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
-# define TPCLS_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
-# endif /* TPCLS_BUILD_DLL */
-#else /* TPCLS_HAS_DLL == 1 */
-# define TPCLS_Export
-# define TPCLS_SINGLETON_DECLARATION(T)
-# define TPCLS_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
-#endif /* TPCLS_HAS_DLL == 1 */
-
-// Set TPCLS_NTRACE = 0 to turn on library specific tracing even if
-// tracing is turned off for ACE.
-#if !defined (TPCLS_NTRACE)
-# if (ACE_NTRACE == 1)
-# define TPCLS_NTRACE 1
-# else /* (ACE_NTRACE == 1) */
-# define TPCLS_NTRACE 0
-# endif /* (ACE_NTRACE == 1) */
-#endif /* !TPCLS_NTRACE */
-
-#if (TPCLS_NTRACE == 1)
-# define TPCLS_TRACE(X)
-#else /* (TPCLS_NTRACE == 1) */
-# define TPCLS_TRACE(X) ACE_TRACE_IMPL(X)
-#endif /* (TPCLS_NTRACE == 1) */
-
-#endif /* TPCLS_EXPORT_H */
-
-// End of auto generated file.
diff --git a/examples/C++NPv2/TPC_Logging_Server.cpp b/examples/C++NPv2/TPC_Logging_Server.cpp
deleted file mode 100644
index 7c78c02d22a..00000000000
--- a/examples/C++NPv2/TPC_Logging_Server.cpp
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
-** $Id$
-**
-** This is the Thread-per-connection logging server example from Chapter 7.
-**
-** Copyright 2002 Addison Wesley. All Rights Reserved.
-*/
-
-#include "ace/OS.h"
-#include "ace/FILE_Addr.h"
-#include "ace/FILE_Connector.h"
-#include "Reactor_Logging_Server_Adapter.h"
-#include "TPC_Logging_Server.h"
-#include "TPCLS_export.h"
-
-int TPC_Logging_Handler::open (void *) {
- static const ACE_TCHAR LOGFILE_SUFFIX[] = ACE_TEXT (".log");
- ACE_TCHAR filename[MAXHOSTNAMELEN + sizeof (LOGFILE_SUFFIX)];
- ACE_INET_Addr logging_peer_addr;
-
- peer ().get_remote_addr (logging_peer_addr);
- logging_peer_addr.get_host_name (filename, MAXHOSTNAMELEN);
- ACE_OS_String::strcat (filename, LOGFILE_SUFFIX);
-
- ACE_FILE_Connector connector;
- connector.connect (log_file_,
- ACE_FILE_Addr (filename),
- 0, // No timeout.
- ACE_Addr::sap_any, // Ignored.
- 0, // Don't try to reuse the addr.
- O_RDWR | O_CREAT | O_APPEND,
- ACE_DEFAULT_FILE_PERMS);
-
- logging_handler_.peer ().set_handle (peer ().get_handle ());
-
- return activate (THR_NEW_LWP | THR_DETACHED);
-}
-
-
-#if !defined (TPC_CERTIFICATE_FILENAME)
-# define TPC_CERTIFICATE_FILENAME "tpc-cert.pem"
-#endif /* !TPC_CERTIFICATE_FILENAME */
-#if !defined (TPC_KEY_FILENAME)
-# define TPC_KEY_FILENAME "tpc-key.pem"
-#endif /* !TPC_KEY_FILENAME */
-
-int TPC_Logging_Acceptor::open
- (const ACE_SOCK_Acceptor::PEER_ADDR &local_addr,
- ACE_Reactor *reactor,
- int flags, int use_select, int reuse_addr) {
- if (PARENT::open (local_addr, reactor, flags,
- use_select, reuse_addr) != 0)
- return -1;
- OpenSSL_add_ssl_algorithms ();
- ssl_ctx_ = SSL_CTX_new (SSLv3_server_method ());
- if (ssl_ctx_ == 0) return -1;
-
- if (SSL_CTX_use_certificate_file (ssl_ctx_,
- TPC_CERTIFICATE_FILENAME,
- SSL_FILETYPE_PEM) <= 0
- || SSL_CTX_use_PrivateKey_file (ssl_ctx_,
- TPC_KEY_FILENAME,
- SSL_FILETYPE_PEM) <= 0
- || !SSL_CTX_check_private_key (ssl_ctx_))
- return -1;
- ssl_ = SSL_new (ssl_ctx_);
- return ssl_ == 0 ? -1 : 0;
-}
-
-
-int TPC_Logging_Acceptor::handle_close (ACE_HANDLE h,
- ACE_Reactor_Mask mask) {
- PARENT::handle_close (h, mask);
- delete this;
- return 0;
-}
-
-
-int TPC_Logging_Acceptor::accept_svc_handler
- (TPC_Logging_Handler *sh) {
- if (PARENT::accept_svc_handler (sh) == -1) return -1;
- SSL_clear (ssl_); // Reset for new SSL connection.
- SSL_set_fd
- (ssl_, ACE_reinterpret_cast (int, sh->get_handle ()));
-
- SSL_set_verify
- (ssl_,
- SSL_VERIFY_PEER | SSL_VERIFY_FAIL_IF_NO_PEER_CERT,
- 0);
- if (SSL_accept (ssl_) == -1
- || SSL_shutdown (ssl_) == -1) return -1;
- return 0;
-}
-
-
-typedef Reactor_Logging_Server_Adapter<TPC_Logging_Acceptor>
- TPC_Logging_Server;
-
-ACE_FACTORY_DEFINE (TPCLS, TPC_Logging_Server)
-
-#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION)
-template class Reactor_Logging_Server_Adapter<TPC_Logging_Acceptor>;
-#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA)
-#pragma instantiate Reactor_Logging_Server_Adapter<TPC_Logging_Acceptor>
-#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */
diff --git a/examples/C++NPv2/TPC_Logging_Server.h b/examples/C++NPv2/TPC_Logging_Server.h
deleted file mode 100644
index 2617c3b95ec..00000000000
--- a/examples/C++NPv2/TPC_Logging_Server.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
-** $Id$
-**
-** This is the Thread-per-connection logging server example from Chapter 7.
-**
-** Copyright 2002 Addison Wesley. All Rights Reserved.
-*/
-
-#ifndef _TPC_LOGGING_SERVER_H
-#define _TPC_LOGGING_SERVER_H
-
-#include "ace/Acceptor.h"
-#include "ace/INET_Addr.h"
-#include "ace/Reactor.h"
-#include "ace/Svc_Handler.h"
-#include "ace/FILE_IO.h"
-#include "Logging_Handler.h"
-
-#include "ace/SOCK_Acceptor.h"
-#include <openssl/ssl.h>
-
-class TPC_Logging_Handler
- : public ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_NULL_SYNCH> {
-protected:
- ACE_FILE_IO log_file_; // File of log records.
-
- // Connection to peer service handler.
- Logging_Handler logging_handler_;
-
-public:
- TPC_Logging_Handler () : logging_handler_ (log_file_) {}
-
- virtual int open (void *);
-
- virtual int svc (void) {
- for (;;)
- switch (logging_handler_.log_record ()) {
- case -1: return -1; // Error.
- case 0: return 0; // Client closed connection.
- default: continue; // Default case.
- }
- /* NOTREACHED */
- return 0;
- }
-};
-
-
-class TPC_Logging_Acceptor
- : public ACE_Acceptor<TPC_Logging_Handler, ACE_SOCK_ACCEPTOR> {
-protected:
- // The SSL ``context'' data structure.
- SSL_CTX *ssl_ctx_;
-
- // The SSL data structure corresponding to authenticated
- // SSL connections.
- SSL *ssl_;
-
-public:
- typedef ACE_Acceptor<TPC_Logging_Handler, ACE_SOCK_ACCEPTOR>
- PARENT;
- typedef ACE_SOCK_Acceptor::PEER_ADDR PEER_ADDR;
-
- // Constructor.
- TPC_Logging_Acceptor (ACE_Reactor *r)
- : PARENT (r), ssl_ctx_ (0), ssl_ (0) {}
-
- // Destructor frees the SSL resources.
- virtual ~TPC_Logging_Acceptor (void) {
- SSL_free (this->ssl_);
- SSL_CTX_free (this->ssl_ctx_);
- }
-
- // Initialize the acceptor instance.
- virtual int open
- (const ACE_SOCK_Acceptor::PEER_ADDR &local_addr,
- ACE_Reactor *reactor = ACE_Reactor::instance (),
- int flags = 0, int use_select = 1, int reuse_addr = 1);
-
- virtual int handle_close
- (ACE_HANDLE = ACE_INVALID_HANDLE,
- ACE_Reactor_Mask = ACE_Event_Handler::ALL_EVENTS_MASK);
-
- // Connection establishment and authentication hook method.
- virtual int accept_svc_handler (TPC_Logging_Handler *sh);
-};
-
-#endif /* _TPC_LOGGING_SERVER_H */
diff --git a/examples/C++NPv2/TPLS.dsp b/examples/C++NPv2/TPLS.dsp
deleted file mode 100644
index 1877a4a258c..00000000000
--- a/examples/C++NPv2/TPLS.dsp
+++ /dev/null
@@ -1,145 +0,0 @@
-# Microsoft Developer Studio Project File - Name="TPLS" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=TPLS - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "TPLS.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "TPLS.mak" CFG="TPLS - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "TPLS - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "TPLS - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "TPLS - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "TPLS___Win32_Release"
-# PROP BASE Intermediate_Dir "TPLS___Win32_Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "TPLS_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "TPLS_EXPORTS" /D "TPLS_BUILD_DLL" /FD /c
-# SUBTRACT CPP /YX
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 ace.lib /nologo /dll /machine:I386 /libpath:"..\..\ace"
-
-!ELSEIF "$(CFG)" == "TPLS - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "TPLS___Win32_Debug"
-# PROP BASE Intermediate_Dir "TPLS___Win32_Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "TPLS_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\.." /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "TPLS_EXPORTS" /D "TPLS_BUILD_DLL" /FD /c
-# SUBTRACT CPP /YX
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 aced.lib /nologo /dll /debug /machine:I386 /out:"Debug/TPLSd.dll" /pdbtype:sept /libpath:"..\..\ace"
-
-!ENDIF
-
-# Begin Target
-
-# Name "TPLS - Win32 Release"
-# Name "TPLS - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\Logging_Acceptor.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\Logging_Event_Handler.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\Logging_Handler.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\TP_Logging_Server.cpp
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\Logging_Acceptor.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\Logging_Event_Handler.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\Logging_Handler.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\TP_Logging_Server.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\TPC_Logging_Server.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\TPLS_export.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/examples/C++NPv2/TPLS_export.h b/examples/C++NPv2/TPLS_export.h
deleted file mode 100644
index 099af48bfd8..00000000000
--- a/examples/C++NPv2/TPLS_export.h
+++ /dev/null
@@ -1,34 +0,0 @@
-
-// -*- C++ -*-
-// $Id$
-// Definition for Win32 Export directives.
-// This file is generated automatically by generate_export_file.pl TPLS
-// ------------------------------
-#ifndef TPLS_EXPORT_H
-#define TPLS_EXPORT_H
-
-#include "ace/config-all.h"
-
-#if !defined (TPLS_HAS_DLL)
-# define TPLS_HAS_DLL 1
-#endif /* ! TPLS_HAS_DLL */
-
-#if defined (TPLS_HAS_DLL) && (TPLS_HAS_DLL == 1)
-# if defined (TPLS_BUILD_DLL)
-# define TPLS_Export ACE_Proper_Export_Flag
-# define TPLS_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
-# define TPLS_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
-# else /* TPLS_BUILD_DLL */
-# define TPLS_Export ACE_Proper_Import_Flag
-# define TPLS_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
-# define TPLS_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
-# endif /* TPLS_BUILD_DLL */
-#else /* TPLS_HAS_DLL == 1 */
-# define TPLS_Export
-# define TPLS_SINGLETON_DECLARATION(T)
-# define TPLS_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
-#endif /* TPLS_HAS_DLL == 1 */
-
-#endif /* TPLS_EXPORT_H */
-
-// End of auto generated file.
diff --git a/examples/C++NPv2/TP_Logging_Server.cpp b/examples/C++NPv2/TP_Logging_Server.cpp
deleted file mode 100644
index 251179032a9..00000000000
--- a/examples/C++NPv2/TP_Logging_Server.cpp
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-** $Id$
-**
-** Copyright 2002 Addison Wesley. All Rights Reserved.
-*/
-
-#include "ace/OS.h"
-#include "ace/Message_Block.h"
-#include "TP_Logging_Server.h"
-
-int TP_Logging_Handler::handle_input (ACE_HANDLE) {
- ACE_Message_Block *mblk = 0;
- if (logging_handler_.recv_log_record (mblk) != -1) {
- ACE_Message_Block *log_blk = 0;
- ACE_NEW_RETURN
- (log_blk, ACE_Message_Block
- (ACE_reinterpret_cast (char *, this)), -1);
- log_blk->cont (mblk);
- ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, guard, lock_, -1);
- if (TP_LOGGING_TASK::instance ()->put (log_blk) == -1)
- { log_blk->release (); return -1; }
- ++queued_count_;
- return 0;
- } else return -1;
-}
-
-
-int
-TP_Logging_Handler::handle_close (ACE_HANDLE handle,
- ACE_Reactor_Mask) {
- int close_now = 0;
- if (handle != ACE_INVALID_HANDLE) {
- ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, guard, lock_, -1);
- if (queued_count_ == 0)
- close_now = 1;
- else
- deferred_close_ = 1;
- } else {
- ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, guard, lock_, -1);
- queued_count_--;
- if (queued_count_ == 0) close_now = deferred_close_;
- }
-
- if (close_now)
- return Logging_Event_Handler::handle_close ();
- return 0;
-}
-
-
-int TP_Logging_Task::svc () {
- for (ACE_Message_Block *log_blk; getq (log_blk) != -1; ) {
- TP_Logging_Handler *tp_handler = ACE_reinterpret_cast
- (TP_Logging_Handler *, log_blk->rd_ptr ());
- Logging_Handler logging_handler (tp_handler->log_file ());
- logging_handler.write_log_record (log_blk->cont ());
-
- log_blk->release ();
- tp_handler->handle_close (ACE_INVALID_HANDLE, 0);
- }
- return 0;
-}
-
-ACE_FACTORY_DEFINE (TPLS, TP_Logging_Server)
-
-#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION)
-template class Reactor_Logging_Server<TP_Logging_Acceptor>;
-#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA)
-#pragma instantiate Reactor_Logging_Server<TP_Logging_Acceptor>
-#elif defined (__GNUC__) && defined (_AIX)
-template ACE_Singleton<TP_Logging_Task, ACE_Null_Mutex> *
- ACE_Singleton<TP_Logging_Task, ACE_Null_Mutex>::singleton_;
-template ACE_Unmanaged_Singleton<TP_Logging_Task, ACE_Null_Mutex> *
- ACE_Unmanaged_Singleton<TP_Logging_Task, ACE_Null_Mutex>::singleton_;
-#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */
diff --git a/examples/C++NPv2/TP_Logging_Server.h b/examples/C++NPv2/TP_Logging_Server.h
deleted file mode 100644
index 1ea62c796ed..00000000000
--- a/examples/C++NPv2/TP_Logging_Server.h
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
-** $Id$
-**
-** Copyright 2002 Addison Wesley. All Rights Reserved.
-*/
-
-#ifndef _TP_LOGGING_SERVER_H
-#define _TP_LOGGING_SERVER_H
-
-#include "ace/OS.h"
-#include "ace/Auto_Ptr.h"
-#include "ace/Singleton.h"
-#include "ace/Synch.h"
-#include "ace/Task.h"
-#include "Logging_Acceptor.h"
-#include "Logging_Event_Handler.h"
-#include "Reactor_Logging_Server.h"
-#include "TPLS_export.h"
-
-class TP_Logging_Task : public ACE_Task<ACE_SYNCH> {
- // Instantiated with an MT synchronization trait.
-public:
- enum { MAX_THREADS = 4 };
-
- virtual int open (void * = 0)
- { return activate (THR_NEW_LWP, MAX_THREADS); }
-
- virtual int put (ACE_Message_Block *mblk,
- ACE_Time_Value *timeout = 0)
- { return putq (mblk, timeout); }
-
- virtual int svc (void);
-};
-
-typedef ACE_Unmanaged_Singleton<TP_Logging_Task, ACE_Null_Mutex>
- TP_LOGGING_TASK;
-
-/*******************************************************/
-
-class TP_Logging_Acceptor;
-
-class TP_Logging_Handler : public Logging_Event_Handler {
- friend class TP_Logging_Acceptor;
-protected:
- virtual ~TP_Logging_Handler () {} // No-op destructor.
-
- // Number of pointers to this class instance that currently
- // reside in the <TP_LOGGING_TASK> singleton's message queue.
- int queued_count_;
-
- // Indicates whether <Logging_Event_Handler::handle_close()>
- // must be called to cleanup and delete this object.
- int deferred_close_;
-
- // Serialize access to <queued_count_> and <deferred_close_>.
- ACE_SYNCH_MUTEX lock_;
-
-public:
- TP_Logging_Handler (ACE_Reactor *reactor)
- : Logging_Event_Handler (reactor),
- queued_count_ (0),
- deferred_close_ (0) {}
-
- // Called when input events occur, e.g., connection or data.
- virtual int handle_input (ACE_HANDLE);
-
- // Called when this object is destroyed, e.g., when it's
- // removed from a reactor.
- virtual int handle_close (ACE_HANDLE, ACE_Reactor_Mask);
-};
-
-/*******************************************************/
-
-class TP_Logging_Acceptor : public Logging_Acceptor {
-public:
- TP_Logging_Acceptor (ACE_Reactor *r = ACE_Reactor::instance ())
- : Logging_Acceptor (r) {}
-
- virtual int handle_input (ACE_HANDLE) {
- TP_Logging_Handler *peer_handler = 0;
- ACE_NEW_RETURN (peer_handler,
- TP_Logging_Handler (reactor ()), -1);
- if (acceptor_.accept (peer_handler->peer ()) == -1) {
- delete peer_handler;
- return -1;
- } else if (peer_handler->open () == -1)
- peer_handler->handle_close (ACE_INVALID_HANDLE, 0);
- return 0;
- }
-};
-
-/*******************************************************/
-
-class TP_Logging_Server : public ACE_Service_Object {
-protected:
- // Contains the reactor, acceptor, and handlers.
- typedef Reactor_Logging_Server<TP_Logging_Acceptor>
- LOGGING_DISPATCHER;
- LOGGING_DISPATCHER *logging_dispatcher_;
-
-public:
- TP_Logging_Server (): logging_dispatcher_ (0) {}
-
- virtual int init (int argc, ACE_TCHAR *argv[]) {
- int i;
- char **array = 0;
- ACE_NEW_RETURN (array, char*[argc], -1);
- ACE_Auto_Array_Ptr<char *> char_argv (array);
-
- for (i = 0; i < argc; ++i)
- char_argv[i] = ACE::strnew (ACE_TEXT_ALWAYS_CHAR (argv[i]));
- ACE_NEW_NORETURN
- (logging_dispatcher_,
- TP_Logging_Server::LOGGING_DISPATCHER
- (i, char_argv.get (), ACE_Reactor::instance ()));
- for (i = 0; i < argc; ++i) ACE::strdelete (char_argv[i]);
- if (logging_dispatcher_ == 0) return -1;
- else return TP_LOGGING_TASK::instance ()->open ();
- }
-
- virtual int fini () {
- TP_LOGGING_TASK::instance ()->flush ();
- TP_LOGGING_TASK::instance ()->wait ();
- TP_LOGGING_TASK::close ();
- delete logging_dispatcher_;
- return 0;
- }
-};
-
-ACE_FACTORY_DECLARE (TPLS, TP_Logging_Handler)
-
-#endif /* _TP_LOGGING_SERVER_H */
diff --git a/examples/C++NPv2/TP_Reactor_Logging_Server.cpp b/examples/C++NPv2/TP_Reactor_Logging_Server.cpp
deleted file mode 100644
index 6e451953c75..00000000000
--- a/examples/C++NPv2/TP_Reactor_Logging_Server.cpp
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
-** $Id$
-**
-** Copyright 2002 Addison Wesley. All Rights Reserved.
-*/
-
-#include "ace/streams.h"
-#include "ace/Auto_Ptr.h"
-#include "ace/Reactor.h"
-#include "ace/TP_Reactor.h"
-#include "ace/Thread_Manager.h"
-
-#if defined (ACE_WIN32) && (!defined (ACE_HAS_STANDARD_CPP_LIBRARY) || \
- (ACE_HAS_STANDARD_CPP_LIBRARY == 0))
-# include <stdio.h>
-#else
-# include <string>
-#endif
-
-#include "Reactor_Logging_Server.h"
-#include "Logging_Acceptor_Ex.h"
-
-typedef Reactor_Logging_Server<Logging_Acceptor_Ex>
- Server_Logging_Daemon;
-
-
-class Quit_Handler : public ACE_Event_Handler {
- friend class ace_dewarn_gplusplus;
-public:
- Quit_Handler (ACE_Reactor *r) : ACE_Event_Handler (r) {}
-
- virtual int handle_exception (ACE_HANDLE) {
- reactor ()->end_reactor_event_loop ();
- return -1; // Trigger call to handle_close() method.
- }
-
- virtual int handle_close (ACE_HANDLE, ACE_Reactor_Mask)
- { delete this; return 0; }
-
-private:
-
- // Private destructor ensures dynamic allocation.
- virtual ~Quit_Handler () {}
-};
-
-
-static ACE_THR_FUNC_RETURN event_loop (void *arg) {
- ACE_Reactor *reactor = ACE_static_cast (ACE_Reactor *, arg);
-
- reactor->owner (ACE_OS::thr_self ());
- reactor->run_reactor_event_loop ();
- return 0;
-}
-
-
-static ACE_THR_FUNC_RETURN controller (void *arg) {
- ACE_Reactor *reactor = ACE_static_cast (ACE_Reactor *, arg);
-
- Quit_Handler *quit_handler = 0;
- ACE_NEW_RETURN (quit_handler, Quit_Handler (reactor), 0);
-
-#if defined (ACE_WIN32) && (!defined (ACE_HAS_STANDARD_CPP_LIBRARY) || \
- (ACE_HAS_STANDARD_CPP_LIBRARY == 0))
- for (;;) {
- char user_input[80];
- gets (user_input);
- if (ACE_OS_String::strcmp (user_input, "quit") == 0) {
- reactor->notify (quit_handler);
- break;
- }
- }
-#else
- for (;;) {
- std::string user_input;
- std::getline (cin, user_input, '\n');
- if (user_input == "quit") {
- reactor->notify (quit_handler);
- break;
- }
- }
-#endif
-
- return 0;
-}
-
-
-int main (int argc, char *argv[])
-{
- const size_t N_THREADS = 4;
- ACE_TP_Reactor tp_reactor;
- ACE_Reactor reactor (&tp_reactor);
- auto_ptr<ACE_Reactor> delete_instance
- (ACE_Reactor::instance (&reactor));
-
- Server_Logging_Daemon *server;
- // Ignore argv[0]...
- --argc; ++argv;
- ACE_NEW_RETURN (server,
- Server_Logging_Daemon (argc, argv,
- ACE_Reactor::instance ()),
- 1);
- ACE_Thread_Manager::instance ()->spawn_n
- (N_THREADS, event_loop, ACE_Reactor::instance ());
- ACE_Thread_Manager::instance ()->spawn
- (controller, ACE_Reactor::instance ());
- return ACE_Thread_Manager::instance ()->wait ();
-}
-
-#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION)
-template class Reactor_Logging_Server<Logging_Acceptor_Ex>;
-#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA)
-#pragma instantiate Reactor_Logging_Server<Logging_Acceptor_Ex>
-#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */
diff --git a/examples/C++NPv2/TP_Reactor_Logging_Server.dsp b/examples/C++NPv2/TP_Reactor_Logging_Server.dsp
deleted file mode 100644
index 7cec09680f7..00000000000
--- a/examples/C++NPv2/TP_Reactor_Logging_Server.dsp
+++ /dev/null
@@ -1,144 +0,0 @@
-# Microsoft Developer Studio Project File - Name="TP_Reactor_Logging_Server" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=TP_Reactor_Logging_Server - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "TP_Reactor_Logging_Server.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "TP_Reactor_Logging_Server.mak" CFG="TP_Reactor_Logging_Server - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "TP_Reactor_Logging_Server - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "TP_Reactor_Logging_Server - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "TP_Reactor_Logging_Server - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c
-# SUBTRACT CPP /YX
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 ace.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\ace"
-
-!ELSEIF "$(CFG)" == "TP_Reactor_Logging_Server - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "TP_Reactor_Logging_Server___Win32_Debug"
-# PROP BASE Intermediate_Dir "TP_Reactor_Logging_Server___Win32_Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\.." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c
-# SUBTRACT CPP /YX
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 aced.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\ace"
-
-!ENDIF
-
-# Begin Target
-
-# Name "TP_Reactor_Logging_Server - Win32 Release"
-# Name "TP_Reactor_Logging_Server - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\Logging_Acceptor.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\Logging_Event_Handler.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\Logging_Event_Handler_Ex.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\Logging_Handler.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\TP_Reactor_Logging_Server.cpp
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\Logging_Acceptor.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\Logging_Acceptor_Ex.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\Logging_Event_Handler.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\Logging_Event_Handler_Ex.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\Logging_Handler.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\Reactor_Logging_Server.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/examples/C++NPv2/WFMO_Reactor_Logging_Server.cpp b/examples/C++NPv2/WFMO_Reactor_Logging_Server.cpp
deleted file mode 100644
index 5daa2f4543d..00000000000
--- a/examples/C++NPv2/WFMO_Reactor_Logging_Server.cpp
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
-** $Id$
-**
-** Copyright 2002 Addison Wesley. All Rights Reserved.
-*/
-
-#include "ace/Reactor.h"
-#include "ace/Synch.h"
-#include "ace/WFMO_Reactor.h"
-#include "ace/Thread_Manager.h"
-
-#include "Reactor_Logging_Server.h"
-#include "Logging_Acceptor_Ex.h"
-#include "Logging_Event_Handler_Ex.h"
-
-
-class Quit_Handler : public ACE_Event_Handler {
-private:
- ACE_Manual_Event quit_seen_;
-
-public:
- Quit_Handler (ACE_Reactor *r) : ACE_Event_Handler (r) {
- SetConsoleMode (ACE_STDIN, ENABLE_LINE_INPUT
- | ENABLE_ECHO_INPUT
- | ENABLE_PROCESSED_INPUT);
- if (reactor ()->register_handler
- (this, quit_seen_.handle ()) == -1
- || ACE_Event_Handler::register_stdin_handler
- (this, r, ACE_Thread_Manager::instance ()) == -1)
- r->end_reactor_event_loop ();
- }
-
- ~Quit_Handler () {
- ACE_Event_Handler::remove_stdin_handler
- (reactor (), ACE_Thread_Manager::instance ());
- reactor ()->remove_handler (quit_seen_.handle (),
- ACE_Event_Handler::DONT_CALL);
- }
-
- virtual int handle_input (ACE_HANDLE h) {
- CHAR user_input[BUFSIZ];
- DWORD count;
- if (!ReadFile (h, user_input, BUFSIZ, &count, 0))
- return -1;
-
- user_input[count] = '\0';
- if (ACE_OS_String::strncmp (user_input, "quit", 4) == 0)
- return -1;
- return 0;
- }
-
- virtual int handle_close (ACE_HANDLE, ACE_Reactor_Mask) {
- quit_seen_.signal ();
- return 0;
- }
-
- virtual int handle_signal (int, siginfo_t *, ucontext_t *) {
- reactor ()->end_reactor_event_loop ();
- return 0;
- }
-};
-
-
-class Logging_Event_Handler_WFMO : public Logging_Event_Handler_Ex
-{
-public:
- Logging_Event_Handler_WFMO (ACE_Reactor *r)
- : Logging_Event_Handler_Ex (r) {}
-
-protected:
- int handle_input (ACE_HANDLE h) {
- ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, monitor, lock_, -1);
- return logging_handler_.log_record ();
- }
-
- ACE_Thread_Mutex lock_; // Serialize threads in thread pool.
-};
-
-
-class Logging_Acceptor_WFMO : public Logging_Acceptor_Ex
-{
-public:
- // Simple constructor to pass ACE_Reactor to base class.
- Logging_Acceptor_WFMO (ACE_Reactor *r = ACE_Reactor::instance ())
- : Logging_Acceptor_Ex (r) {};
-
-protected:
- virtual int handle_input (ACE_HANDLE) {
- Logging_Event_Handler_WFMO *peer_handler = 0;
- ACE_NEW_RETURN (peer_handler,
- Logging_Event_Handler_WFMO (reactor ()),
- -1);
-
- if (acceptor_.accept (peer_handler->peer ()) == -1) {
- delete peer_handler;
- return -1;
- } else if (peer_handler->open () == -1) {
- peer_handler->handle_close ();
- return -1;
- }
- return 0;
- }
-};
-
-
-static ACE_THR_FUNC_RETURN event_loop (void *arg) {
- ACE_Reactor *reactor = ACE_static_cast (ACE_Reactor *, arg);
-
- reactor->owner (ACE_OS::thr_self ());
- reactor->run_reactor_event_loop ();
- return 0;
-}
-
-
-typedef Reactor_Logging_Server<Logging_Acceptor_WFMO>
- Server_Logging_Daemon;
-
-
-int main (int argc, char *argv[])
-{
- const size_t N_THREADS = 4;
- ACE_WFMO_Reactor wfmo_reactor;
- ACE_Reactor reactor (&wfmo_reactor);
-
- Server_Logging_Daemon *server;
- // Ignore argv[0]...
- --argc; ++argv;
- ACE_NEW_RETURN (server,
- Server_Logging_Daemon (argc, argv, &reactor),
- 1);
- Quit_Handler quit_handler (&reactor);
- ACE_Thread_Manager::instance ()->spawn_n
- (N_THREADS, event_loop, &reactor);
- return ACE_Thread_Manager::instance ()->wait ();
-}
diff --git a/examples/C++NPv2/WFMO_Reactor_Logging_Server.dsp b/examples/C++NPv2/WFMO_Reactor_Logging_Server.dsp
deleted file mode 100644
index 769accdf594..00000000000
--- a/examples/C++NPv2/WFMO_Reactor_Logging_Server.dsp
+++ /dev/null
@@ -1,144 +0,0 @@
-# Microsoft Developer Studio Project File - Name="WFMO_Reactor_Logging_Server" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=WFMO_Reactor_Logging_Server - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "WFMO_Reactor_Logging_Server.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "WFMO_Reactor_Logging_Server.mak" CFG="WFMO_Reactor_Logging_Server - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "WFMO_Reactor_Logging_Server - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "WFMO_Reactor_Logging_Server - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "WFMO_Reactor_Logging_Server - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c
-# SUBTRACT CPP /YX
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 ace.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\ace"
-
-!ELSEIF "$(CFG)" == "WFMO_Reactor_Logging_Server - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "WFMO_Reactor_Logging_Server___Win32_Debug"
-# PROP BASE Intermediate_Dir "WFMO_Reactor_Logging_Server___Win32_Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\.." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c
-# SUBTRACT CPP /YX
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 aced.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\ace"
-
-!ENDIF
-
-# Begin Target
-
-# Name "WFMO_Reactor_Logging_Server - Win32 Release"
-# Name "WFMO_Reactor_Logging_Server - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\Logging_Acceptor.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\Logging_Event_Handler.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\Logging_Event_Handler_Ex.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\Logging_Handler.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\WFMO_Reactor_Logging_Server.cpp
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\Logging_Acceptor.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\Logging_Acceptor_Ex.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\Logging_Event_Handler.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\Logging_Event_Handler_Ex.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\Logging_Handler.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\Reactor_Logging_Server.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/examples/C++NPv2/display_logfile.cpp b/examples/C++NPv2/display_logfile.cpp
deleted file mode 100644
index 16ace4a5cb5..00000000000
--- a/examples/C++NPv2/display_logfile.cpp
+++ /dev/null
@@ -1,363 +0,0 @@
-/*
-** $Id$
-**
-** Copyright 2002 Addison Wesley. All Rights Reserved.
-*/
-
-#include "ace/OS.h"
-#include "ace/CDR_Stream.h"
-#include "ace/FILE_Addr.h"
-#include "ace/FILE_Connector.h"
-#include "ace/FILE_IO.h"
-#include "ace/Message_Block.h"
-#include "ace/Module.h"
-#include "ace/SString.h"
-#include "ace/Stream.h"
-#include "ace/Synch.h"
-#include "ace/Task.h"
-#include "ace/Thread_Manager.h"
-
-template <class TASK>
-class Logrec_Module : public ACE_Module<ACE_SYNCH>
-{
-public:
- Logrec_Module (const ACE_TCHAR *name)
- : ACE_Module<ACE_SYNCH>
- (name,
- &task_, // Initialize writer-side task.
- 0, // Ignore reader-side task.
- 0,
- ACE_Module<ACE_SYNCH>::M_DELETE_READER) {}
-private:
- TASK task_;
-};
-#define LOGREC_MODULE(NAME) \
- typedef Logrec_Module<NAME> NAME##_Module
-
-class Logrec_Reader : public ACE_Task<ACE_SYNCH>
-{
-private:
- ACE_TString filename_; // Name of logfile.
- ACE_FILE_IO logfile_; // File containing log records.
-
-public:
- enum {MB_CLIENT = ACE_Message_Block::MB_USER,
- MB_TYPE, MB_PID, MB_TIME, MB_TEXT};
-
- Logrec_Reader (const ACE_TString &file): filename_ (file) {}
-
- virtual int open (void *) {
- ACE_FILE_Addr name (filename_.c_str ());
- ACE_FILE_Connector connector;
- if (connector.connect (logfile_, name) == -1)
- return -1;
- return activate ();
- }
-
- virtual int svc () {
- const size_t FileReadSize = 8 * 1024;
- ACE_Message_Block mblk (FileReadSize);
-
- for (;; mblk.crunch ()) {
- // Read as much as will fit in the message block.
- ssize_t bytes_read = logfile_.recv (mblk.wr_ptr (),
- mblk.space ());
- if (bytes_read <= 0)
- break;
- mblk.wr_ptr (ACE_static_cast (size_t, bytes_read));
-
- // We have a bunch of data from the log file. The data is
- // arranged like so:
- // hostname\0
- // CDR-encoded log record
- // So, first we scan for the end of the host name, then
- // initialize another ACE_Message_Block aligned for CDR
- // demarshaling and copy the remainder of the block into it. We
- // can't use duplicate() because we need to be sure the data
- // pointer is aligned properly for CDR demarshaling. If at any
- // point, there's not enough data left in the message block to
- // extract what's needed, crunch the block to move all remaining
- // data to the beginning and read more from the file.
- for (;;) {
- size_t name_len = ACE_OS_String::strnlen
- (mblk.rd_ptr (), mblk.length ());
- if (name_len == mblk.length ()) break;
-
- char *name_p = mblk.rd_ptr ();
- ACE_Message_Block *rec, *head, *temp;
- ACE_NEW_RETURN
- (head, ACE_Message_Block (name_len, MB_CLIENT), 0);
- head->copy (name_p, name_len);
- mblk.rd_ptr (name_len + 1); // Skip nul also
-
- size_t need = mblk.length () + ACE_CDR::MAX_ALIGNMENT;
- ACE_NEW_RETURN (rec, ACE_Message_Block (need), 0);
- ACE_CDR::mb_align (rec);
- rec->copy (mblk.rd_ptr (), mblk.length ());
-
- // Now rec contains the remaining data we've read so far from
- // the file. Create an ACE_InputCDR to start demarshaling the
- // log record, header first to find the length, then the data.
- // Since the ACE_InputCDR constructor increases the reference count
- // on rec, we release it upon return to prevent leaks.
- // The cdr 'read' methods return 0 on failure, 1 on success.
- ACE_InputCDR cdr (rec); rec->release ();
- ACE_CDR::Boolean byte_order;
- if (!cdr.read_boolean (byte_order)) {
- head->release (); rec->release (); break;
- }
- cdr.reset_byte_order (byte_order);
-
- // Now read the length of the record. From there, we'll know
- // if rec contains the complete record or not.
- ACE_CDR::ULong length;
- if (!cdr.read_ulong (length)) {
- head->release (); mblk.rd_ptr (name_p); break;
- }
- if (length > cdr.length ()) {
- head->release (); mblk.rd_ptr (name_p); break;
- }
-
- // The complete record is in rec... grab all the fields into
- // separate, chained message blocks.
- ACE_NEW_RETURN (temp,
- ACE_Message_Block (length, MB_TEXT),
- 0);
- ACE_NEW_RETURN
- (temp,
- ACE_Message_Block (2 * sizeof (ACE_CDR::Long),
- MB_TIME, temp),
- 0);
- ACE_NEW_RETURN
- (temp,
- ACE_Message_Block (sizeof (ACE_CDR::Long),
- MB_PID, temp),
- 0);
- ACE_NEW_RETURN
- (temp,
- ACE_Message_Block (sizeof (ACE_CDR::Long),
- MB_TYPE, temp),
- 0);
- head->cont (temp);
-
- // Extract the type
- ACE_CDR::Long *lp;
- lp = ACE_reinterpret_cast
- (ACE_CDR::Long*, temp->wr_ptr ());
- cdr >> *lp;
- temp->wr_ptr (sizeof (ACE_CDR::Long));
- temp = temp->cont ();
-
- // Extract the pid
- lp = ACE_reinterpret_cast
- (ACE_CDR::Long*, temp->wr_ptr ());
- cdr >> *lp;
- temp->wr_ptr (sizeof (ACE_CDR::Long));
- temp = temp->cont ();
-
- // Extract the timestamp (2 Longs)
- lp = ACE_reinterpret_cast
- (ACE_CDR::Long*, temp->wr_ptr ());
- cdr >> *lp; ++lp; cdr >> *lp;
- temp->wr_ptr (2 * sizeof (ACE_CDR::Long));
- temp = temp->cont ();
-
- // Demarshal the length of the message text, then demarshal
- // the text into the block.
- ACE_CDR::ULong text_len;
- cdr >> text_len;
- cdr.read_char_array (temp->wr_ptr (), text_len);
- temp->wr_ptr (text_len);
-
- // Forward the whole lot to the next module.
- if (put_next (head) == -1) break;
-
- // Move the file-content block's read pointer up past whatever
- // was just processed. Although the mblk's rd_ptr has not been
- // moved, cdr's has. Therefore, use its length() to determine
- // how much is left.
- mblk.rd_ptr (mblk.length () - cdr.length ());
- }
- }
-
- // Now that the file is done, send a block down the stream to tell
- // the other modules to stop.
- ACE_Message_Block *stop;
- ACE_NEW_RETURN
- (stop, ACE_Message_Block (0, ACE_Message_Block::MB_STOP),
- 0);
- put_next (stop);
- return 0;
- }
-};
-
-class Logrec_Reader_Module : public ACE_Module<ACE_SYNCH>
-{
-public:
- Logrec_Reader_Module (const ACE_TString &filename)
- : ACE_Module<ACE_SYNCH>
- (ACE_TEXT ("Logrec Reader"),
- &task_, // Initialize writer-side.
- 0, // Ignore reader-side.
- 0,
- ACE_Module<ACE_SYNCH>::M_DELETE_READER),
- task_ (filename) {}
-private:
- Logrec_Reader task_;
-};
-
-class Logrec_Writer : public ACE_Task<ACE_SYNCH>
-{
-public:
- // Initialization hook method.
- virtual int open (void *) { return activate (); }
-
- virtual int put (ACE_Message_Block *mblk, ACE_Time_Value *to)
- { return putq (mblk, to); }
-
- virtual int svc () {
- int stop = 0;
- for (ACE_Message_Block *mb; !stop && getq (mb) != -1; ) {
- if (mb->msg_type () == ACE_Message_Block::MB_STOP)
- stop = 1;
- else
- ACE::write_n (ACE_STDOUT, mb);
- put_next (mb);
- }
- return 0;
- }
-};
-
-LOGREC_MODULE (Logrec_Writer);
-
-class Logrec_Formatter : public ACE_Task<ACE_SYNCH>
-{
-public:
- typedef void (*FORMATTER[5])(ACE_Message_Block *);
-private:
- static FORMATTER format_; // Array of format static methods.
-
-public:
- virtual int put (ACE_Message_Block *mblk, ACE_Time_Value *) {
- if (mblk->msg_type () == Logrec_Reader::MB_CLIENT)
- for (ACE_Message_Block *temp = mblk;
- temp != 0;
- temp = temp->cont ()) {
- int mb_type =
- temp->msg_type () - ACE_Message_Block::MB_USER;
- (*format_[mb_type])(temp);
- }
- return put_next (mblk);
- }
-
- static void format_client (ACE_Message_Block *) {
- return;
- }
-
- static void format_type (ACE_Message_Block *mblk) {
- ACE_CDR::Long type = * (ACE_CDR::Long *)mblk->rd_ptr ();
- mblk->size (11); // Max size in ASCII of 32-bit word.
- mblk->reset ();
- mblk->wr_ptr ((size_t) sprintf (mblk->wr_ptr (), "%d", type));
- }
-
- static void format_pid (ACE_Message_Block *mblk) {
- ACE_CDR::Long pid = * (ACE_CDR::Long *)mblk->rd_ptr ();
- mblk->size (11); // Max size in ASCII of 32-bit word.
- mblk->reset ();
- mblk->wr_ptr ((size_t) sprintf (mblk->wr_ptr (), "%d", pid));
- }
-
- static void format_time (ACE_Message_Block *mblk) {
- ACE_CDR::Long secs = * (ACE_CDR::Long *)mblk->rd_ptr ();
- mblk->rd_ptr (sizeof (ACE_CDR::Long));
- ACE_CDR::Long usecs = * (ACE_CDR::Long *)mblk->rd_ptr ();
- char timestamp[26]; // Max size of ctime_r() string.
- time_t time_secs (secs);
- ACE_OS::ctime_r (&time_secs, timestamp, sizeof timestamp);
- mblk->size (26); // Max size of ctime_r() string.
- mblk->reset ();
- timestamp[19] = '\0'; // NUL-terminate after the time.
- timestamp[24] = '\0'; // NUL-terminate after the date.
- size_t fmt_len (sprintf (mblk->wr_ptr (),
- "%s.%03d %s",
- timestamp + 4,
- usecs / 1000,
- timestamp + 20));
- mblk->wr_ptr (fmt_len);
- }
-
- static void format_data (ACE_Message_Block *) {
- return;
- }
-};
-
-Logrec_Formatter::FORMATTER Logrec_Formatter::format_ = {
- format_client, format_type, format_pid, format_time, format_data
-};
-
-LOGREC_MODULE (Logrec_Formatter);
-
-class Logrec_Separator : public ACE_Task<ACE_SYNCH>
-{
-private:
- ACE_Lock_Adapter<ACE_SYNCH_MUTEX> lock_strategy_;
-
-public:
- virtual int put (ACE_Message_Block *mblk,
- ACE_Time_Value *) {
- if (mblk->msg_type () != ACE_Message_Block::MB_STOP) {
- ACE_Message_Block *separator;
- ACE_NEW_RETURN
- (separator,
- ACE_Message_Block (ACE_OS::strlen ("|") + 1,
- ACE_Message_Block::MB_DATA,
- 0, 0, 0, &lock_strategy_),
- -1);
- separator->copy ("|");
-
- ACE_Message_Block *dup = 0;
- for (ACE_Message_Block *temp = mblk; temp != 0; ) {
- dup = separator->duplicate ();
- dup->cont (temp->cont ());
- temp->cont (dup);
- temp = dup->cont ();
- }
- ACE_Message_Block *nl;
- ACE_NEW_RETURN (nl, ACE_Message_Block (2), 0);
- nl->copy ("\n");
- dup->cont (nl);
- separator->release ();
- }
- return put_next (mblk);
- }
-};
-
-LOGREC_MODULE (Logrec_Separator);
-
-int main (int argc, char *argv[])
-{
- if (argc != 2)
- ACE_ERROR_RETURN ((LM_ERROR,
- "usage: %s logfile\n", argv[0]),
- 1);
- ACE_TString logfile (ACE_TEXT_CHAR_TO_TCHAR (argv[1]));
- ACE_Stream<ACE_SYNCH> stream;
-
- if (stream.push
- (new Logrec_Writer_Module (ACE_TEXT ("Writer"))) != -1
- && stream.push
- (new Logrec_Separator_Module (ACE_TEXT ("Separator"))) != -1
- && stream.push
- (new Logrec_Formatter_Module (ACE_TEXT ("Formatter"))) != -1
- && stream.push
- (new Logrec_Reader_Module (logfile)) != -1)
- return ACE_Thread_Manager::instance ()->wait () == 0 ? 0 : 1;
- return 1;
-}
-
-#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION)
-template class ACE_Lock_Adapter<ACE_Thread_Mutex>;
-#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA)
-#pragma instantiate ACE_Lock_Adapter<ACE_Thread_Mutex>
-#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */
diff --git a/examples/C++NPv2/display_logfile.dsp b/examples/C++NPv2/display_logfile.dsp
deleted file mode 100644
index fdf6e71e7c6..00000000000
--- a/examples/C++NPv2/display_logfile.dsp
+++ /dev/null
@@ -1,104 +0,0 @@
-# Microsoft Developer Studio Project File - Name="display_logfile" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=display_logfile - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "display_logfile.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "display_logfile.mak" CFG="display_logfile - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "display_logfile - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "display_logfile - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "display_logfile - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c
-# SUBTRACT CPP /YX
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 ace.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\ace"
-
-!ELSEIF "$(CFG)" == "display_logfile - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\.." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c
-# SUBTRACT CPP /YX
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 aced.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\ace"
-
-!ENDIF
-
-# Begin Target
-
-# Name "display_logfile - Win32 Release"
-# Name "display_logfile - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\display_logfile.cpp
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/examples/C++NPv2/examples.dsw b/examples/C++NPv2/examples.dsw
deleted file mode 100644
index a74ce5af2a8..00000000000
--- a/examples/C++NPv2/examples.dsw
+++ /dev/null
@@ -1,191 +0,0 @@
-Microsoft Developer Studio Workspace File, Format Version 6.00
-# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
-
-###############################################################################
-
-Project: "AC_CLD"=".\AC_CLD.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Project: "AIO_CLD"=".\AIO_CLD.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Project: "CLD"=".\CLD.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Project: "Configurable_Logging_Server"=".\Configurable_Logging_Server.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name SLD
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name SLDex
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "Reactor_Logging_Server"=".\Reactor_Logging_Server.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Project: "SLD"=".\SLD.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Project: "SLDex"=".\SLDex.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Project: "SR_Configurable_Logging_Server"=".\SR_Configurable_Logging_Server.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Project: "Select_Reactor_Logging_Server"=".\Select_Reactor_Logging_Server.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Project: "TPCLS"=".\TPCLS.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Project: "TPLS"=".\TPLS.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Project: "TP_Reactor_Logging_Server"=".\TP_Reactor_Logging_Server.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Project: "WFMO_Reactor_Logging_Server"=".\WFMO_Reactor_Logging_Server.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Project: "display_logfile"=".\display_logfile.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Global:
-
-Package=<5>
-{{{
-}}}
-
-Package=<3>
-{{{
-}}}
-
-###############################################################################
-
diff --git a/examples/C++NPv2/svc.conf b/examples/C++NPv2/svc.conf
deleted file mode 100644
index e97f3748cf6..00000000000
--- a/examples/C++NPv2/svc.conf
+++ /dev/null
@@ -1,8 +0,0 @@
-static Service_Reporter "-p $SERVICE_REPORTER_PORT"
-
-dynamic AIO_Client_Logging_Daemon Service_Object *
-AIO_CLD:_make_AIO_Client_Logging_Daemon()
- "-p 7777"
-
-dynamic Server_Logging_Daemon Service_Object *
-TPCLS:_make_TPC_Logging_Server()