summaryrefslogtreecommitdiff
path: root/ace
diff options
context:
space:
mode:
authorschmidt <douglascraigschmidt@users.noreply.github.com>1996-11-24 23:25:58 +0000
committerschmidt <douglascraigschmidt@users.noreply.github.com>1996-11-24 23:25:58 +0000
commitae3742d1d6afe6974dfb95acab3b7b99776f30a4 (patch)
tree12679470148b109564cc28a52fa7aeb5732f5b00 /ace
parent1d68bf26a8df9cf5b878a2070ab7d82e966eabc9 (diff)
downloadATCD-ae3742d1d6afe6974dfb95acab3b7b99776f30a4.tar.gz
Done
Diffstat (limited to 'ace')
-rw-r--r--ace/Event_Handler.cpp172
-rw-r--r--ace/Event_Handler.i174
-rw-r--r--ace/Message_Block.cpp18
-rw-r--r--ace/Message_Block.h6
-rw-r--r--ace/OS.cpp8
-rw-r--r--ace/OS.h5
-rw-r--r--ace/OS.i24
-rw-r--r--ace/README2
-rw-r--r--ace/ReactorEx.h1
-rw-r--r--ace/Service_Config.h1
-rw-r--r--ace/Svc_Conf.y11
-rw-r--r--ace/Svc_Conf_Tokens.h3
-rw-r--r--ace/Svc_Conf_l.cpp10
-rw-r--r--ace/Svc_Conf_y.cpp66
-rw-r--r--ace/Thread.h1
-rw-r--r--ace/UPIPE_Acceptor.cpp12
-rw-r--r--ace/UPIPE_Connector.cpp3
-rw-r--r--ace/UPIPE_Connector.h1
-rw-r--r--ace/UPIPE_Stream.cpp29
-rw-r--r--ace/UPIPE_Stream.h15
-rw-r--r--ace/config-vxworks-ghs-1.8.h1
-rw-r--r--ace/config-vxworks5.2-g++.h1
-rw-r--r--ace/config-win32-msvc4.0.h17
-rw-r--r--ace/ws2tcpip.h86
24 files changed, 405 insertions, 262 deletions
diff --git a/ace/Event_Handler.cpp b/ace/Event_Handler.cpp
index c0cc76fbd09..e23bfb231f4 100644
--- a/ace/Event_Handler.cpp
+++ b/ace/Event_Handler.cpp
@@ -9,3 +9,175 @@
#include "ace/Event_Handler.i"
#endif /* __ACE_INLINE__ */
+// Implement conceptually abstract virtual functions in the base class
+// so derived classes don't have to implement unused ones.
+
+ACE_Event_Handler::ACE_Event_Handler (void)
+ : priority_ (ACE_Event_Handler::LO_PRIORITY),
+ reactor_ (0),
+ reactorex_ (0),
+ proactor_ (0)
+{
+ ACE_TRACE ("ACE_Event_Handler::ACE_Event_Handler");
+}
+
+ACE_Event_Handler::~ACE_Event_Handler (void)
+{
+ ACE_TRACE ("ACE_Event_Handler::~ACE_Event_Handler");
+}
+
+// Gets the file descriptor associated with this I/O device.
+
+ACE_HANDLE
+ACE_Event_Handler::get_handle (void) const
+{
+ ACE_TRACE ("ACE_Event_Handler::get_handle");
+ return ACE_INVALID_HANDLE;
+}
+
+// Sets the file descriptor associated with this I/O device.
+
+void
+ACE_Event_Handler::set_handle (ACE_HANDLE)
+{
+ ACE_TRACE ("ACE_Event_Handler::set_handle");
+}
+
+// Gets the priority of this handler.
+
+int
+ACE_Event_Handler::get_priority (void) const
+{
+ ACE_TRACE ("ACE_Event_Handler::get_priority");
+ return this->priority_;
+}
+
+// Sets the priority
+
+void
+ACE_Event_Handler::set_priority (int priority)
+{
+ ACE_TRACE ("ACE_Event_Handler::set_priority");
+ this->priority_ = priority;
+}
+
+// Called when the object is about to be removed from the Dispatcher
+// tables.
+
+int
+ACE_Event_Handler::handle_close (ACE_HANDLE, ACE_Reactor_Mask)
+{
+ ACE_TRACE ("ACE_Event_Handler::handle_close");
+ return -1;
+}
+
+// Called when input becomes available on fd.
+
+int
+ACE_Event_Handler::handle_input (ACE_HANDLE)
+{
+ ACE_TRACE ("ACE_Event_Handler::handle_input");
+ return -1;
+}
+
+// Called when output is possible on fd.
+
+int
+ACE_Event_Handler::handle_output (ACE_HANDLE)
+{
+ ACE_TRACE ("ACE_Event_Handler::handle_output");
+ return -1;
+}
+
+// Called when urgent data is available on fd.
+
+int
+ACE_Event_Handler::handle_exception (ACE_HANDLE)
+{
+ ACE_TRACE ("ACE_Event_Handler::handle_exception");
+ return -1;
+}
+
+// Called when timer expires, TV stores the current time.
+
+int
+ACE_Event_Handler::handle_timeout (const ACE_Time_Value &, const void *)
+{
+ ACE_TRACE ("ACE_Event_Handler::handle_timeout");
+ return -1;
+}
+
+// Called when a registered signal occurs.
+
+int
+ACE_Event_Handler::handle_signal (int, siginfo_t *, ucontext_t *)
+{
+ ACE_TRACE ("ACE_Event_Handler::handle_signal");
+ return -1;
+}
+
+int
+ACE_Event_Handler::handle_input_complete (ACE_Message_Block *, long)
+{
+ ACE_TRACE ("ACE_Event_Handler::handle_input_complete");
+ return -1;
+}
+
+int
+ACE_Event_Handler::handle_output_complete (ACE_Message_Block *, long)
+{
+ ACE_TRACE ("ACE_Event_Handler::handle_input_complete");
+ return -1;
+}
+
+ACE_Message_Block *
+ACE_Event_Handler::get_message (void)
+{
+ ACE_TRACE ("ACE_Event_Handler::get_message");
+ return 0;
+}
+
+void
+ACE_Event_Handler::reactor (ACE_Reactor *reactor)
+{
+ ACE_TRACE ("ACE_Event_Handler::reactor");
+ this->reactor_ = reactor;
+}
+
+ACE_Reactor *
+ACE_Event_Handler::reactor (void) const
+{
+ ACE_TRACE ("ACE_Event_Handler::Reactor");
+ return this->reactor_;
+}
+
+void
+ACE_Event_Handler::reactorex (ACE_ReactorEx *reactorex)
+{
+ ACE_TRACE ("ACE_Event_Handler::reactorex");
+ this->reactorex_ = reactorex;
+}
+
+ACE_ReactorEx *
+ACE_Event_Handler::reactorex (void) const
+{
+ ACE_TRACE ("ACE_Event_Handler::ReactorEx");
+
+ return this->reactorex_;
+}
+
+void
+ACE_Event_Handler::proactor (ACE_Proactor *proactor)
+{
+ ACE_TRACE ("ACE_Event_Handler::proactor");
+
+ this->proactor_ = proactor;
+}
+
+ACE_Proactor *
+ACE_Event_Handler::proactor (void) const
+{
+ ACE_TRACE ("ACE_Event_Handler::Proactor");
+
+ return this->proactor_;
+}
diff --git a/ace/Event_Handler.i b/ace/Event_Handler.i
index d9e30724ce5..18110dfeffe 100644
--- a/ace/Event_Handler.i
+++ b/ace/Event_Handler.i
@@ -4,178 +4,4 @@
#include "ace/Event_Handler.h"
// Event_Handler.i
-// Implement conceptually abstract virtual functions in the base class
-// so derived classes don't have to implement unused ones.
-
-ACE_INLINE
-ACE_Event_Handler::ACE_Event_Handler (void)
- : priority_ (ACE_Event_Handler::LO_PRIORITY),
- reactor_ (0),
- reactorex_ (0),
- proactor_ (0)
-{
- ACE_TRACE ("ACE_Event_Handler::ACE_Event_Handler");
-}
-
-ACE_INLINE
-ACE_Event_Handler::~ACE_Event_Handler (void)
-{
- ACE_TRACE ("ACE_Event_Handler::~ACE_Event_Handler");
-}
-
-// Gets the file descriptor associated with this I/O device.
-
-ACE_INLINE ACE_HANDLE
-ACE_Event_Handler::get_handle (void) const
-{
- ACE_TRACE ("ACE_Event_Handler::get_handle");
- return ACE_INVALID_HANDLE;
-}
-
-// Sets the file descriptor associated with this I/O device.
-
-ACE_INLINE void
-ACE_Event_Handler::set_handle (ACE_HANDLE)
-{
- ACE_TRACE ("ACE_Event_Handler::set_handle");
-}
-
-// Gets the priority of this handler.
-
-ACE_INLINE int
-ACE_Event_Handler::get_priority (void) const
-{
- ACE_TRACE ("ACE_Event_Handler::get_priority");
- return this->priority_;
-}
-
-// Sets the priority
-
-ACE_INLINE void
-ACE_Event_Handler::set_priority (int priority)
-{
- ACE_TRACE ("ACE_Event_Handler::set_priority");
- this->priority_ = priority;
-}
-
-// Called when the object is about to be removed from the Dispatcher
-// tables.
-
-ACE_INLINE int
-ACE_Event_Handler::handle_close (ACE_HANDLE, ACE_Reactor_Mask)
-{
- ACE_TRACE ("ACE_Event_Handler::handle_close");
- return -1;
-}
-
-// Called when input becomes available on fd.
-
-ACE_INLINE int
-ACE_Event_Handler::handle_input (ACE_HANDLE)
-{
- ACE_TRACE ("ACE_Event_Handler::handle_input");
- return -1;
-}
-
-// Called when output is possible on fd.
-
-ACE_INLINE int
-ACE_Event_Handler::handle_output (ACE_HANDLE)
-{
- ACE_TRACE ("ACE_Event_Handler::handle_output");
- return -1;
-}
-
-// Called when urgent data is available on fd.
-
-ACE_INLINE int
-ACE_Event_Handler::handle_exception (ACE_HANDLE)
-{
- ACE_TRACE ("ACE_Event_Handler::handle_exception");
- return -1;
-}
-
-// Called when timer expires, TV stores the current time.
-
-ACE_INLINE int
-ACE_Event_Handler::handle_timeout (const ACE_Time_Value &, const void *)
-{
- ACE_TRACE ("ACE_Event_Handler::handle_timeout");
- return -1;
-}
-
-// Called when a registered signal occurs.
-
-ACE_INLINE int
-ACE_Event_Handler::handle_signal (int, siginfo_t *, ucontext_t *)
-{
- ACE_TRACE ("ACE_Event_Handler::handle_signal");
- return -1;
-}
-
-ACE_INLINE int
-ACE_Event_Handler::handle_input_complete (ACE_Message_Block *, long)
-{
- ACE_TRACE ("ACE_Event_Handler::handle_input_complete");
- return -1;
-}
-
-ACE_INLINE int
-ACE_Event_Handler::handle_output_complete (ACE_Message_Block *, long)
-{
- ACE_TRACE ("ACE_Event_Handler::handle_input_complete");
- return -1;
-}
-
-ACE_INLINE ACE_Message_Block *
-ACE_Event_Handler::get_message (void)
-{
- ACE_TRACE ("ACE_Event_Handler::get_message");
- return 0;
-}
-
-ACE_INLINE void
-ACE_Event_Handler::reactor (ACE_Reactor *reactor)
-{
- ACE_TRACE ("ACE_Event_Handler::reactor");
- this->reactor_ = reactor;
-}
-
-ACE_INLINE ACE_Reactor *
-ACE_Event_Handler::reactor (void) const
-{
- ACE_TRACE ("ACE_Event_Handler::Reactor");
- return this->reactor_;
-}
-
-ACE_INLINE void
-ACE_Event_Handler::reactorex (ACE_ReactorEx *reactorex)
-{
- ACE_TRACE ("ACE_Event_Handler::reactorex");
- this->reactorex_ = reactorex;
-}
-
-ACE_INLINE ACE_ReactorEx *
-ACE_Event_Handler::reactorex (void) const
-{
- ACE_TRACE ("ACE_Event_Handler::ReactorEx");
-
- return this->reactorex_;
-}
-
-ACE_INLINE void
-ACE_Event_Handler::proactor (ACE_Proactor *proactor)
-{
- ACE_TRACE ("ACE_Event_Handler::proactor");
-
- this->proactor_ = proactor;
-}
-
-ACE_INLINE ACE_Proactor *
-ACE_Event_Handler::proactor (void) const
-{
- ACE_TRACE ("ACE_Event_Handler::Proactor");
-
- return this->proactor_;
-}
diff --git a/ace/Message_Block.cpp b/ace/Message_Block.cpp
index 96e94d460ae..5c0947f806a 100644
--- a/ace/Message_Block.cpp
+++ b/ace/Message_Block.cpp
@@ -28,6 +28,24 @@ ACE_Message_Block::copy (const char *buf, size_t n)
}
}
+int
+ACE_Message_Block::copy (const char *buf)
+{
+ ACE_TRACE ("ACE_Message_Block::copy");
+ // Note that for this to work correct, end() *must* be >= wr_ptr().
+ size_t len = size_t (this->end () - this->wr_ptr ());
+ size_t buflen = ACE_OS::strlen (buf) + 1;
+
+ if (len < buflen)
+ return -1;
+ else
+ {
+ (void) ACE_OS::memcpy (this->wr_ptr (), buf, buflen);
+ this->wr_ptr (buflen);
+ return 0;
+ }
+}
+
void
ACE_Message_Block::dump (void) const
{
diff --git a/ace/Message_Block.h b/ace/Message_Block.h
index c94fbfffc81..599e1039813 100644
--- a/ace/Message_Block.h
+++ b/ace/Message_Block.h
@@ -1,7 +1,6 @@
/* -*- C++ -*- */
// $Id$
-
// ============================================================================
//
// = LIBRARY
@@ -153,6 +152,11 @@ public:
// the wr_ptr() offset. Return 0 if succeeds and -1 if the size of
// the message is too small...
+ int copy (const char *buf);
+ // Copies <buf> into the Message_Block starting at the wr_ptr()
+ // offset. This call assumees that <buf> is NUL-terminated. Return
+ // 0 if succeeds and -1 if the size of the message is too small...
+
char *base (void) const;
// Get message data.
diff --git a/ace/OS.cpp b/ace/OS.cpp
index 916f6a2adc6..b0aaac73e43 100644
--- a/ace/OS.cpp
+++ b/ace/OS.cpp
@@ -407,12 +407,12 @@ ACE_TSS_Cleanup::exit (void *status)
#if defined (ACE_HAS_MFC)
// allow CWinThread-destructor to be invoked from AfxEndThread
- // _endthreadex() will be called from AfxEndThread so don't exit the
+ // _endthreadex will be called from AfxEndThread so don't exit the
// thread now if we are running an MFC thread.
- // if (ACE_BIT_DISABLED (flags, THR_USE_AFX))
+ CWinThread *pThread = ::AfxGetThread ();
+ if (!pThread || pThread->m_nThreadID != ACE_OS::thr_self ())
#endif /* ACE_HAS_MFC */
- ::_endthreadex ((DWORD) status);
-
+ ::_endthreadex ((DWORD) status);
#if 0
::ExitThread ((DWORD) status);
#endif
diff --git a/ace/OS.h b/ace/OS.h
index 4cd84cda48a..97147e5854e 100644
--- a/ace/OS.h
+++ b/ace/OS.h
@@ -1035,7 +1035,12 @@ PAGE_NOCACHE */
#include /**/ <windows.h>
#endif /* __AFX_H__ */
+#if defined (ACE_HAS_WINSOCK2)
+#include /**/ <winsock2.h>
+#include "ace/ws2tcpip.h"
+#else
#include /**/ <winsock.h>
+#endif /* ACE_HAS_WINSOCK2 */
#define MAXHOSTNAMELEN 256
diff --git a/ace/OS.i b/ace/OS.i
index 98b041ef234..8bbd83d6825 100644
--- a/ace/OS.i
+++ b/ace/OS.i
@@ -159,7 +159,7 @@ extern "C" char *mktemp (char *);
#define ACE_ADAPT_RETVAL(OP,RESULT) ((RESULT = (OP)) != 0 ? (errno = RESULT, -1) : 0)
#endif /* VXWORKS */
-#if defined (SIGNAL_SAFE_OS_CALLS)
+#if defined (ACE_HAS_SIGNAL_SAFE_OS_CALLS)
#include "ace/Log_Msg.h"
// The following two macros ensure that system calls are properly
// restarted (if necessary) when interrupts occur.
@@ -178,7 +178,7 @@ extern "C" char *mktemp (char *);
#else
#define ACE_OSCALL_RETURN(OP,TYPE,FAILVALUE) do { TYPE ace_result_ = FAILVALUE; ace_result_ = ace_result_; return OP; } while (0)
#define ACE_OSCALL(OP,TYPE,FAILVALUE,RESULT) do { RESULT = (TYPE) OP; } while (0)
-#endif /* SIGNAL_SAFE_OS_CALLS */
+#endif /* ACE_HAS_SIGNAL_SAFE_OS_CALLS */
ACE_INLINE int
ACE_OS::chdir (const char *path)
@@ -3212,23 +3212,13 @@ ACE_OS::thr_sigsetmask (int how,
ACE_OSCALL_RETURN (ACE_ADAPT_RETVAL (::thr_sigsetmask (how, nsm, osm),
ace_result_),
int, -1);
-#elif defined (ACE_HAS_SETKIND_NP)
- // ACE_OSCALL_RETURN (ACE_ADAPT_RETVAL (::sigaction (how, nsm, osm),
- // ace_result_),
- // int, -1);
- // commented this out since nothing appropriate
- // found in the man pages...
- ACE_NOTSUP_RETURN (-1);
-
-#elif defined (ACE_HAS_DCETHREADS)
-#if defined (ACE_HAS_PTHREADS_1003_DOT_1C)
- ACE_OSCALL_RETURN (ACE_ADAPT_RETVAL (::pthread_sigaction (how, nsm, osm),
- ace_result_), int, -1);
-#else
+#elif defined (ACE_HAS_SETKIND_NP) || defined (ACE_HAS_DCETHREADS)
+ // DCE threads have no such function.
+ ACE_NOTSUP_RETURN (-1);
+#elif defined (ACE_HAS_PTHREADS_1003_DOT_1C)
+ // PTHREADS_1003_DOT_1C is NOT a subcase of DCETHREADS!
ACE_OSCALL_RETURN (ACE_ADAPT_RETVAL (::sigthreadmask (how, nsm, osm),
ace_result_), int, -1);
-#endif /* ACE_HAS_PTHREADS_1003_DOT_1C */
-
#elif defined (ACE_HAS_PTHREADS) && !defined (ACE_HAS_FSU_PTHREADS)
#if defined (ACE_HAS_IRIX62_THREADS) || defined (DIGITAL_UNIX)
ACE_OSCALL_RETURN (ACE_ADAPT_RETVAL (::pthread_sigmask (how, nsm, osm),
diff --git a/ace/README b/ace/README
index 2faf0ba6c2f..a4d5eb6ebbe 100644
--- a/ace/README
+++ b/ace/README
@@ -72,6 +72,7 @@ ACE_HAS_RTLD_LAZY_V Explicit dynamic linking permits "lazy" symbol resolution
ACE_HAS_SELECT_H Platform has special header for select().
ACE_HAS_SEMUN Compiler/platform defines a union semun for SysV shared memory
ACE_HAS_SIGINFO_T Platform supports SVR4 extended signals
+ACE_HAS_SIGNAL_SAFE_OS_CALLS Automatically restart OS system calls when EINTR occurs
ACE_HAS_SIGWAIT Platform/compiler has the sigwait(2) prototype
ACE_HAS_SIG_ATOMIC_T Compiler/platform defines the sig_atomic_t typedef
ACE_HAS_SIN_LEN Platform supports new BSD inet_addr len field.
@@ -121,6 +122,7 @@ ACE_HAS_UNICODE Platform/compiler supports UNICODE
ACE_HAS_VOIDPTR_MMAP Platform requires void * for mmap().
ACE_HAS_VOIDPTR_SOCKOPT OS/compiler uses void * arg 4 setsockopt() rather than const char *
ACE_HAS_WIN32_TRYLOCK The Win32 platform support TryEnterCriticalSection()
+ACE_HAS_WINSOCK2 The Win32 platform supports WinSock 2.0
ACE_HAS_XLI Platform has the XLI version of TLI
ACE_HAS_XT Platform has Xt and Motif
ACE_HAS_YIELD_VOID_PTR Platform requires pthread_yield() to take a NULL.
diff --git a/ace/ReactorEx.h b/ace/ReactorEx.h
index 3b1bcc84a4b..18c2e0a0be0 100644
--- a/ace/ReactorEx.h
+++ b/ace/ReactorEx.h
@@ -1,7 +1,6 @@
/* -*- C++ -*- */
// $Id$
-
// ============================================================================
//
// = LIBRARY
diff --git a/ace/Service_Config.h b/ace/Service_Config.h
index a0389f40c57..d462f3b4752 100644
--- a/ace/Service_Config.h
+++ b/ace/Service_Config.h
@@ -1,7 +1,6 @@
/* -*- C++ -*- */
// $Id$
-
// ============================================================================
//
// = LIBRARY
diff --git a/ace/Svc_Conf.y b/ace/Svc_Conf.y
index 842fbf1ce7b..b75324a7c52 100644
--- a/ace/Svc_Conf.y
+++ b/ace/Svc_Conf.y
@@ -23,7 +23,7 @@ ACE_Obstack *ace_obstack;
%start svc_config_entries
-%type <ident_> ACE_IDENT ACE_STRING ACE_PATHNAME parameters_opt
+%type <ident_> ACE_IDENT ACE_STRING ACE_PATHNAME pathname parameters_opt
%type <type_> type status
%type <parse_node_> dynamic static suspend resume remove module_list stream
%type <parse_node_> stream_modules module svc_config_entry
@@ -207,11 +207,11 @@ status
;
svc_initializer
- : ACE_PATHNAME ACE_COLON ACE_IDENT
+ : pathname ACE_COLON ACE_IDENT
{
$$ = new ACE_Object_Node ($1, $3);
}
- | ACE_PATHNAME ACE_COLON ACE_IDENT ACE_LPAREN ACE_RPAREN
+ | pathname ACE_COLON ACE_IDENT ACE_LPAREN ACE_RPAREN
{
$$ = new ACE_Function_Node ($1, $3);
}
@@ -237,6 +237,11 @@ parameters_opt
| /* EMPTY */ { $$ = 0; }
;
+pathname
+ : ACE_PATHNAME
+ | ACE_IDENT
+ ;
+
%%
// Prints the error string to standard output. Cleans up the error
// messages.
diff --git a/ace/Svc_Conf_Tokens.h b/ace/Svc_Conf_Tokens.h
index 39e0e0ac4f0..4b5d3b3e8f1 100644
--- a/ace/Svc_Conf_Tokens.h
+++ b/ace/Svc_Conf_Tokens.h
@@ -1,6 +1,3 @@
-/* -*- C++ -*- */
-// $Id$
-
#define ACE_DYNAMIC 257
#define ACE_STATIC 258
#define ACE_SUSPEND 259
diff --git a/ace/Svc_Conf_l.cpp b/ace/Svc_Conf_l.cpp
index 9495714f23a..acce4462d2c 100644
--- a/ace/Svc_Conf_l.cpp
+++ b/ace/Svc_Conf_l.cpp
@@ -1,6 +1,8 @@
+#include "ace/config.h"
+#if defined (HPUX) || defined (VXWORKS)
+#include "ace/OS.h"
+#endif /* HPUX || VXWORKS */
/* A lexical scanner generated by flex */
-// $Id$
-
/* Scanner skeleton version:
* $Header$
@@ -8,10 +10,6 @@
#define FLEX_SCANNER
-#include "ace/config.h"
-#if defined (HPUX) || defined (VXWORKS)
-#include "ace/OS.h"
-#endif /* HPUX || VXWORKS */
#include /**/ <stdio.h>
diff --git a/ace/Svc_Conf_y.cpp b/ace/Svc_Conf_y.cpp
index b094b72247d..f0415eef51c 100644
--- a/ace/Svc_Conf_y.cpp
+++ b/ace/Svc_Conf_y.cpp
@@ -1,6 +1,4 @@
#ifndef lint
-// @(#)Svc_Conf_y.cpp 1.1 10/18/96
-
char ace_yysccsid[] = "@(#)yaccpar 1.4 (Berkeley) 02/25/90 \n\
Modified 5/2/90 by J. Roskind to support graphic debugging modes";
#endif
@@ -44,56 +42,58 @@ ACE_Obstack *ace_obstack;
#define ACE_COLON 276
#define YYERRCODE 256
short ace_yylhs[] = { -1,
- 0, 0, 0, 13, 13, 13, 13, 13, 13, 4,
- 5, 6, 7, 8, 10, 17, 10, 14, 14, 18,
- 11, 11, 9, 9, 12, 12, 12, 12, 12, 15,
- 3, 3, 3, 16, 16, 2, 2, 2, 1, 1,
+ 0, 0, 0, 14, 14, 14, 14, 14, 14, 5,
+ 6, 7, 8, 9, 11, 18, 11, 15, 15, 19,
+ 12, 12, 10, 10, 13, 13, 13, 13, 13, 16,
+ 4, 4, 4, 17, 17, 3, 3, 3, 2, 2,
+ 1, 1,
};
short ace_yylen[] = { 2,
2, 2, 0, 1, 1, 1, 1, 1, 1, 3,
3, 2, 2, 2, 3, 0, 4, 1, 1, 0,
4, 0, 2, 0, 1, 1, 1, 1, 1, 4,
1, 1, 0, 3, 5, 2, 2, 2, 1, 0,
+ 1, 1,
};
short ace_yydefred[] = { 3,
0, 2, 0, 0, 0, 0, 0, 0, 4, 5,
6, 7, 8, 9, 1, 0, 0, 0, 12, 13,
14, 16, 18, 19, 0, 0, 0, 0, 0, 39,
- 10, 11, 0, 20, 15, 36, 38, 37, 0, 0,
- 17, 24, 0, 31, 32, 30, 0, 0, 21, 25,
- 26, 27, 28, 29, 23, 0, 35,
+ 10, 11, 0, 20, 15, 36, 38, 37, 41, 42,
+ 0, 0, 17, 24, 0, 31, 32, 30, 0, 0,
+ 21, 25, 26, 27, 28, 29, 23, 0, 35,
};
short ace_yydgoto[] = { 1,
- 31, 29, 46, 9, 10, 11, 12, 13, 47, 14,
- 35, 55, 15, 25, 17, 40, 33, 42,
+ 41, 31, 29, 48, 9, 10, 11, 12, 13, 49,
+ 14, 35, 57, 15, 25, 17, 42, 33, 44,
};
short ace_yysindex[] = { 0,
- -244, 0, -266, -260, -250, -243, -239, -247, 0, 0,
+ -244, 0, -266, -260, -250, -243, -241, -247, 0, 0,
0, 0, 0, 0, 0, -240, -237, -237, 0, 0,
- 0, 0, 0, 0, -242, -241, -235, -233, -236, 0,
- 0, 0, -242, 0, 0, 0, 0, 0, -232, -238,
- 0, 0, -234, 0, 0, 0, -253, -228, 0, 0,
- 0, 0, 0, 0, 0, -227, 0,
+ 0, 0, 0, 0, -238, -236, -233, -231, -239, 0,
+ 0, 0, -238, 0, 0, 0, 0, 0, 0, 0,
+ -242, -235, 0, 0, -232, 0, 0, 0, -253, -226,
+ 0, 0, 0, 0, 0, 0, 0, -234, 0,
};
short ace_yyrindex[] = { 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 27, 27, 0, 0,
0, 0, 0, 0, 46, 0, 0, 0, 0, 0,
- 0, 0, 46, 0, 0, 0, 0, 0, 0, 20,
- 0, 0, 0, 0, 0, 0, 0, 1, 0, 0,
- 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 46, 0, 0, 0, 0, 0, 0, 0,
+ 0, 20, 0, 0, 0, 0, 0, 0, 0, 1,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0,
};
short ace_yygindex[] = { 0,
- 18, 0, 0, -8, -6, -10, -9, 2, 0, 0,
- 14, 0, 0, 0, 0, 0, 0, 0,
+ 0, 18, 0, 0, -8, -6, -9, -2, -1, 0,
+ 0, 16, 0, 0, 0, 0, 0, 0, 0,
};
#define YYTABLESIZE 308
short ace_yytable[] = { 23,
34, 24, 16, 3, 4, 5, 6, 7, 18, 3,
4, 2, 3, 4, 5, 6, 7, 8, 19, 33,
- 49, 22, 26, 27, 28, 20, 40, 44, 45, 21,
- 34, 39, 30, 36, 48, 32, 52, 53, 50, 37,
- 51, 38, 56, 43, 57, 22, 41, 0, 54, 0,
+ 51, 22, 26, 27, 28, 20, 40, 21, 39, 40,
+ 46, 47, 30, 45, 34, 32, 50, 59, 36, 54,
+ 52, 37, 53, 38, 58, 22, 55, 56, 43, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -124,9 +124,9 @@ short ace_yytable[] = { 23,
short ace_yycheck[] = { 8,
0, 8, 269, 257, 258, 259, 260, 261, 269, 257,
258, 256, 257, 258, 259, 260, 261, 262, 269, 0,
- 274, 269, 263, 264, 265, 269, 0, 266, 267, 269,
- 273, 268, 270, 275, 269, 18, 47, 47, 47, 275,
- 47, 275, 271, 276, 272, 0, 33, -1, 47, -1,
+ 274, 269, 263, 264, 265, 269, 0, 269, 268, 269,
+ 266, 267, 270, 276, 273, 18, 269, 272, 275, 49,
+ 49, 275, 49, 275, 271, 0, 49, 49, 33, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
@@ -208,13 +208,15 @@ char *ace_yyrule[] = {
"status : ACE_ACTIVE",
"status : ACE_INACTIVE",
"status :",
-"svc_initializer : ACE_PATHNAME ACE_COLON ACE_IDENT",
-"svc_initializer : ACE_PATHNAME ACE_COLON ACE_IDENT ACE_LPAREN ACE_RPAREN",
+"svc_initializer : pathname ACE_COLON ACE_IDENT",
+"svc_initializer : pathname ACE_COLON ACE_IDENT ACE_LPAREN ACE_RPAREN",
"type : ACE_MODULE_T ACE_STAR",
"type : ACE_SVC_OBJ_T ACE_STAR",
"type : ACE_STREAM_T ACE_STAR",
"parameters_opt : ACE_STRING",
"parameters_opt :",
+"pathname : ACE_PATHNAME",
+"pathname : ACE_IDENT",
};
#endif
#define ace_yyclearin (ace_yychar=(-1))
@@ -237,7 +239,7 @@ YYSTYPE ace_yylval;
#define ace_yystacksize YYSTACKSIZE
short ace_yyss[YYSTACKSIZE];
YYSTYPE ace_yyvs[YYSTACKSIZE];
-#line 241 "Svc_Conf.y"
+#line 246 "Svc_Conf.y"
// Prints the error string to standard output. Cleans up the error
// messages.
@@ -340,7 +342,7 @@ main (int argc, char *argv[])
return ace_yyparse ();
}
#endif /* DEBUGGING */
-#line 342 "y.tab.c"
+#line 346 "y.tab.c"
#define YYABORT goto ace_yyabort
#define YYACCEPT goto ace_yyaccept
#define YYERROR goto ace_yyerrlab
@@ -861,7 +863,7 @@ case 40:
#line 237 "Svc_Conf.y"
{ ace_yyval.ident_ = 0; }
break;
-#line 862 "y.tab.c"
+#line 866 "y.tab.c"
}
ace_yyssp -= ace_yym;
ace_yystate = *ace_yyssp;
diff --git a/ace/Thread.h b/ace/Thread.h
index 1579dc4e29f..4880b824f8e 100644
--- a/ace/Thread.h
+++ b/ace/Thread.h
@@ -1,7 +1,6 @@
/* -*- C++ -*- */
// $Id$
-
// ============================================================================
//
// = LIBRARY
diff --git a/ace/UPIPE_Acceptor.cpp b/ace/UPIPE_Acceptor.cpp
index 9d3f97fcb77..2312869be0d 100644
--- a/ace/UPIPE_Acceptor.cpp
+++ b/ace/UPIPE_Acceptor.cpp
@@ -72,15 +72,19 @@ ACE_UPIPE_Acceptor::accept (ACE_UPIPE_Stream &new_stream,
else
{
ACE_UPIPE_Stream *remote_stream = 0;
- // Transfer address ownership.
+
+ ACE_MT (ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, new_stream.lock_, -1));
+
new_stream.set_handle (new_io.get_handle ());
+ new_stream.reference_count_++;
+ // Transfer address ownership.
new_io.get_local_addr (new_stream.local_addr_);
new_io.get_remote_addr (new_stream.remote_addr_);
-
- // Now that we got the fd, we'll read the address of the
+
+ // Now that we got the handle, we'll read the address of the
// connector-side ACE_UPIPE_Stream out of the pipe and link that
- // ACE_UPIPE_Stream to our ACE_UPIPE_Stream
+ // ACE_UPIPE_Stream to our ACE_UPIPE_Stream.
if (ACE_OS::read (new_stream.get_handle (),
(char *) &remote_stream,
diff --git a/ace/UPIPE_Connector.cpp b/ace/UPIPE_Connector.cpp
index f8e6cce603e..eeba0f7a8dd 100644
--- a/ace/UPIPE_Connector.cpp
+++ b/ace/UPIPE_Connector.cpp
@@ -43,10 +43,13 @@ ACE_UPIPE_Connector::connect (ACE_UPIPE_Stream &new_stream,
#endif
else // We're connected!
{
+ ACE_MT (ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, new_stream.lock_, -1));
+
ACE_UPIPE_Stream *ustream = &new_stream;
new_stream.set_handle (handle);
new_stream.remote_addr_ = addr; // class copy.
+ new_stream.reference_count_++;
// Now send the address of our ACE_UPIPE_Stream over this pipe
// to our corresponding ACE_UPIPE_Acceptor, so he may link the
diff --git a/ace/UPIPE_Connector.h b/ace/UPIPE_Connector.h
index 56fe8cb5b15..1e29b83270c 100644
--- a/ace/UPIPE_Connector.h
+++ b/ace/UPIPE_Connector.h
@@ -1,7 +1,6 @@
/* -*- C++ -*- */
// $Id$
-
// ============================================================================
//
// = LIBRARY
diff --git a/ace/UPIPE_Stream.cpp b/ace/UPIPE_Stream.cpp
index 3c9bed43494..b4bffcee7ae 100644
--- a/ace/UPIPE_Stream.cpp
+++ b/ace/UPIPE_Stream.cpp
@@ -13,6 +13,14 @@
ACE_ALLOC_HOOK_DEFINE(ACE_UPIPE_Stream)
+ACE_UPIPE_Stream::ACE_UPIPE_Stream (void)
+ : remaining_ (0),
+ reference_count_ (0),
+ mb_last_ (0)
+{
+ ACE_TRACE ("ACE_UPIPE_Stream::ACE_UPIPE_STREAM");
+}
+
int
ACE_UPIPE_Stream::control (ACE_IO_Cntl_Msg::ACE_IO_Cntl_Cmds cmd,
void * val)
@@ -31,14 +39,22 @@ int
ACE_UPIPE_Stream::close (void)
{
ACE_TRACE ("ACE_UPIPE_Stream::close");
- // Since the UPIPE should have been closed earlier we won't bother
- // checking to see if closing it now fails.
+ ACE_MT (ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, this->lock_, -1));
- if (this->ACE_SPIPE::get_handle () != ACE_INVALID_HANDLE)
- this->ACE_SPIPE::close ();
+ this->reference_count_--;
+
+ if (this->reference_count_ == 0)
+ {
+ // Since the UPIPE should have been closed earlier we won't bother
+ // checking to see if closing it now fails.
- // Close down the ACE_stream.
- return this->stream_.close (0);
+ if (this->ACE_SPIPE::get_handle () != ACE_INVALID_HANDLE)
+ this->ACE_SPIPE::close ();
+
+ // Close down the ACE_stream.
+ return this->stream_.close (0);
+ }
+ return 0;
}
int
@@ -73,7 +89,6 @@ ACE_UPIPE_Stream::send (const char *buffer,
ACE_TRACE ("ACE_UPIPE_Stream::send");
ACE_Message_Block *mb_p;
-
ACE_NEW_RETURN (mb_p, ACE_Message_Block (n), -1);
mb_p->copy (buffer, n);
diff --git a/ace/UPIPE_Stream.h b/ace/UPIPE_Stream.h
index 64313fcea99..d3e223bca07 100644
--- a/ace/UPIPE_Stream.h
+++ b/ace/UPIPE_Stream.h
@@ -1,7 +1,6 @@
/* -*- C++ -*- */
// $Id$
-
// ============================================================================
//
// = LIBRARY
@@ -36,7 +35,10 @@ class ACE_Export ACE_UPIPE_Stream : public ACE_SPIPE
friend class ACE_UPIPE_Acceptor;
friend class ACE_UPIPE_Connector;
public:
- // = Termination.
+
+ // = Initialization and Termination.
+
+ ACE_UPIPE_Stream (void);
int close (void);
// Shut down the UPIPE and release resources.
@@ -107,6 +109,15 @@ private:
MT_Stream stream_;
// Stream component used by the <UPIPE_Acceptor> and
// <UPIPE_Connector> to link together two UPIPE_Streams.
+
+ int reference_count_;
+ // Keep track of whether the sender and receiver have both shut
+ // down.
+
+#if defined (ACE_MT_SAFE)
+ ACE_Thread_Mutex lock_;
+ // Ensure that we are thread-safe.
+#endif /* ACE_MT_SAFE */
};
#if defined (__ACE_INLINE__)
diff --git a/ace/config-vxworks-ghs-1.8.h b/ace/config-vxworks-ghs-1.8.h
index e478198fe2c..9204d3f60d1 100644
--- a/ace/config-vxworks-ghs-1.8.h
+++ b/ace/config-vxworks-ghs-1.8.h
@@ -40,7 +40,6 @@
#define ACE_LACKS_UCONTEXT_H
#define ACE_LACKS_UTSNAME_T
#define ACE_MT_SAFE
-#define SIGNAL_SAFE_OS_CALLS
// Defines the page size of the system.
#define ACE_PAGE_SIZE 4096
diff --git a/ace/config-vxworks5.2-g++.h b/ace/config-vxworks5.2-g++.h
index 3922136e172..deaeac7d28e 100644
--- a/ace/config-vxworks5.2-g++.h
+++ b/ace/config-vxworks5.2-g++.h
@@ -44,7 +44,6 @@
#define ACE_MT_SAFE
#define ACE_TEMPLATES_REQUIRE_SOURCE
#define ACE_TEMPLATES_REQUIRE_SPECIALIZATION
-#define SIGNAL_SAFE_OS_CALLS
// Defines the page size of the system.
#define ACE_PAGE_SIZE 4096
diff --git a/ace/config-win32-msvc4.0.h b/ace/config-win32-msvc4.0.h
index e6c49c327bd..bc0dcfa9f98 100644
--- a/ace/config-win32-msvc4.0.h
+++ b/ace/config-win32-msvc4.0.h
@@ -43,8 +43,21 @@
#include /**/ <windows.h> // if he's not doing MFC, snag this
#endif
+// Define the following two macros if you're compiling with WinSock 2.0.
+// #define ACE_HAS_WINSOCK2
+// #define ACE_WSOCK_VERSION 2, 0
+
+// Undefine the following macro if you're compiling with WinSock 2.0.
+// Version 1.1 of WinSock
+#define ACE_WSOCK_VERSION 1, 1
+
// Needed for timeval.
-#include /**/ <winsock.h>
+#if defined (ACE_HAS_WINSOCK2)
+#include /**/ <winsock2.h>
+#include "ace/ws2tcpip.h"
+#else
+#include /**/ <winsock.h>
+#endif /* ACE_HAS_WINSOCK2 */
#define ACE_HAS_UNICODE
#define ACE_HAS_STL
@@ -71,8 +84,6 @@
// Compiler doesn't support static data member templates.
#define ACE_LACKS_STATIC_DATA_MEMBER_TEMPLATES
-// Version 1.1 of WinSock
-#define ACE_WSOCK_VERSION 1, 1
#define ACE_LACKS_RECVMSG
#define ACE_LACKS_SENDMSG
diff --git a/ace/ws2tcpip.h b/ace/ws2tcpip.h
new file mode 100644
index 00000000000..45ecd2e6bf5
--- /dev/null
+++ b/ace/ws2tcpip.h
@@ -0,0 +1,86 @@
+/*
+** WS2TCPIP.H - WinSock2 Extension for TCP/IP protocols
+**
+** This file contains TCP/IP specific information for use
+** by WinSock2 compatible applications.
+**
+** To provide the backward compatibility, all the TCP/IP
+** specific definitions that were included in the WINSOCK.H
+** file are now included in WINSOCK2.H file. WS2TCPIP.H
+** file includes only the definitions introduced in the
+** "WinSock 2 Protocol-Specific Annex" document.
+**
+** Rev 0.3 Nov 13, 1995
+*/
+
+#ifndef _WS2TCPIP_H_
+#define _WS2TCPIP_H_
+
+/* Structure to keep interface specific information */
+
+typedef struct _INTERFACE_INFO
+{
+ u_long iiFlags; /* Interface flags */
+ struct sockaddr iiAddress; /* Interface address */
+ struct sockaddr iiBroadcastAddress; /* Broadcast address */
+ struct sockaddr iiNetmask; /* Network mask */
+} INTERFACE_INFO;
+
+/* Possible flags for the iiFlags - bitmask */
+
+#define IFF_UP 0x00000001 /* Interface is up */
+#define IFF_BROADCAST 0x00000002 /* Broadcast is supported */
+#define IFF_LOOPBACK 0x00000004 /* this is loopback interface */
+#define IFF_POINTTOPOINT 0x00000008 /*this is point-to-point
+interface*/
+#define IFF_MULTICAST 0x00000010 /* multicast is supported */
+
+/* Argument structure for IP_ADD_MEMBERSHIP and IP_DROP_MEMBERSHIP */
+
+struct ip_mreq {
+ struct in_addr imr_multiaddr; /* IP multicast address of group */
+ struct in_addr imr_interface; /* local IP address of interface */
+};
+
+/* TCP/IP specific Ioctl codes */
+
+#define SIO_GET_INTERFACE_LIST <TBD>
+
+/* Option to use with [gs]etsockopt at the IPPROTO_IP level */
+
+#define IP_OPTIONS 1 /* set/get IP options */
+#define IP_HDRINCL 2 /* header is included with data */
+#define IP_TOS 3 /* IP type of service and preced*/
+#define IP_TTL 4 /* IP time to live */
+#define IP_MULTICAST_IF 9 /* set/get IP multicast i/f */
+#define IP_MULTICAST_TTL 10 /* set/get IP multicast ttl */
+#define IP_MULTICAST_LOOP 11 /*set/get IP multicast loopback */
+#define IP_ADD_MEMBERSHIP 12 /* add an IP group membership */
+#define IP_DROP_MEMBERSHIP 13/* drop an IP group membership */
+
+
+/* Option to use with [gs]etsockopt at the IPPROTO_UDP level */
+
+#define UDP_NOCHECKSUM 1
+
+/* Option to use with [gs]etsockopt at the IPPROTO_TCP level */
+
+#define TCP_EXPEDITED_1122 0x0002
+
+
+/* IPv6 definitions */
+
+struct in_addr6 {
+ u_char s6_addr[16]; /* IPv6 address */
+};
+
+struct sockaddr_in6 {
+ short sin6_family; /* AF_INET6 */
+ u_short sin6_port; /* Transport level port numb
+er */
+ u_long sin6_flowinfo; /* IPv6 flow information */
+ struct in_addr6 sin6_addr; /* IPv6 address */
+};
+
+
+#endif /* _WS2TCPIP_H_ */