summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorirfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1997-08-27 03:03:34 +0000
committerirfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1997-08-27 03:03:34 +0000
commitadd97873bbf9b853ffced75d6dfa397717ae8ba7 (patch)
tree1947490ee8e0e919553ca1945fccf6d228803453
parent225fb83fd3307989464ebca821401d46e5d26774 (diff)
downloadATCD-add97873bbf9b853ffced75d6dfa397717ae8ba7.tar.gz
*** empty log message ***
-rw-r--r--examples/Reactor/ReactorEx/README224
-rw-r--r--examples/Reactor/ReactorEx/reactorex.mak428
-rw-r--r--examples/Reactor/ReactorEx/reactorex.mdpbin78848 -> 73728 bytes
-rw-r--r--examples/Reactor/ReactorEx/test_exceptions.cpp31
-rw-r--r--examples/Reactor/ReactorEx/test_multithreading.cpp (renamed from examples/Reactor/WFMO_Reactor/test_MT.cpp)14
-rw-r--r--examples/Reactor/ReactorEx/test_network_events.cpp183
-rw-r--r--examples/Reactor/ReactorEx/test_registration.cpp154
-rw-r--r--examples/Reactor/ReactorEx/test_removals.cpp (renamed from examples/Reactor/WFMO_Reactor/test_remove_handler.cpp)12
-rw-r--r--examples/Reactor/ReactorEx/test_talker.cpp (renamed from examples/Reactor/WFMO_Reactor/test_reactorEx.cpp)151
-rw-r--r--examples/Reactor/ReactorEx/test_timeouts.cpp (renamed from examples/Reactor/ReactorEx/test_timeout.cpp)37
-rw-r--r--examples/Reactor/WFMO_Reactor/README224
-rw-r--r--examples/Reactor/WFMO_Reactor/reactorex.mak428
-rw-r--r--examples/Reactor/WFMO_Reactor/reactorex.mdpbin78848 -> 73728 bytes
-rw-r--r--examples/Reactor/WFMO_Reactor/test_exceptions.cpp31
-rw-r--r--examples/Reactor/WFMO_Reactor/test_multithreading.cpp (renamed from examples/Reactor/ReactorEx/test_MT.cpp)14
-rw-r--r--examples/Reactor/WFMO_Reactor/test_network_events.cpp183
-rw-r--r--examples/Reactor/WFMO_Reactor/test_registration.cpp154
-rw-r--r--examples/Reactor/WFMO_Reactor/test_removals.cpp (renamed from examples/Reactor/ReactorEx/test_remove_handler.cpp)12
-rw-r--r--examples/Reactor/WFMO_Reactor/test_talker.cpp (renamed from examples/Reactor/ReactorEx/test_reactorEx.cpp)151
-rw-r--r--examples/Reactor/WFMO_Reactor/test_timeouts.cpp (renamed from examples/Reactor/WFMO_Reactor/test_timeout.cpp)37
20 files changed, 1514 insertions, 954 deletions
diff --git a/examples/Reactor/ReactorEx/README b/examples/Reactor/ReactorEx/README
deleted file mode 100644
index 429899b9132..00000000000
--- a/examples/Reactor/ReactorEx/README
+++ /dev/null
@@ -1,224 +0,0 @@
-The ACE_ReactorEx encapsulates the Win32 WaitForMultipleObjects() API
-within ACE. The ACE_ReactorEx is similar in spirit to the
-ACE_Reactor, except that (1) it is much simpler and (2) it works for
-the complete range of Win32 handles (whereas the ACE_Reactor just
-works for socket handles.
-
-Here's the API for the ACE_ReactorEx:
-
-class ACE_ReactorEx
-{
-public:
- // = Event loop.
- virtual int handle_events (ACE_Time_Value *);
-
- // = Handler registration management.
- virtual int register_handler (ACE_Event_Handler *);
- virtual int remove_handler (ACE_Event_Handler *);
-
- virtual int notify (void);
-
- // = Timer management
- virtual int schedule_timer (), etc.
- // ...
-};
-
-----------------------------------------
-
-Here's how you might use it:
-
-----------------------------------------
-
-class My_Thread_Handler : public ACE_Event_Handler
-{
-public:
- My_Thread_Handler (void) {
- // Create a thread that will run
- // for a time and then exit.
- this->thread_handle_ =
- ACE_OS::thr_create (run, ......);
- }
-
- // Called back by the ACE_ReactorEx when the
- // event is signaled.
- virtual int handle_signal (int)
- {
- cout << "thread is done" << endl;
- }
-
- virtual ACE_HANDLE get_handle (void) const
- {
- return this->thread_handle_;
- }
-
-private:
- ACE_HANDLE thread_handle_;
-
- static void *run (void *) {
- // Sleep for a while and then exit.
- ACE_OS::sleep (100000);
- return 0;
- }
-};
-
-----------------------------------------
-
-The main program might look something like this:
-
-----------------------------------------
-
-int main (void)
-{
- // ...
- ACE_ReactorEx dispatcher;
- My_Thread_Handler handler;
-
- // Register the thread handler.
- dispatcher.register_handler (&handler);
-
- // Block until the thread exits and the
- // handle_signal() method of the My_Thread_Handler
- // is called!
- dispatcher.handle_events ();
-
- // ...
-}
-
-----------------------------------------
-
-. test_timeout --
-
-This example application shows how to write ReactorEx and Proactor
-event loops that handle events for some fixed amount of time. It uses
-ACE_ReactorEx::run_event_loop(run_time) to handle
-events for run_time seconds. The output should be the following:
-
-1 timeout occurred for Foo.
-2 timeout occurred for Bar.
-3 timeout occurred for Foo.
-4 timeout occurred for Bar.
-5 timeout occurred for Foo.
-6 timeout occurred for Bar.
-7 timeout occurred for Foo.
-8 timeout occurred for Foo.
-9 timeout occurred for Bar.
-10 timeout occurred for Foo.
-11 timeout occurred for Bar.
-12 timeout occurred for Foo.
-
-. test_remove_handler --
-
-This application tests the ReactorEx's ability to handle simultaneous
-events. If you pass anything on the command-line, then each handler
-requests to be removed from the ReactorEx after each event. This has
-a funky effect on the order in which handlers are serviced. So, if no
-parameters are passed in, the handlers should be serviced 1 through
-MAXIMUM_WAIT_OBJECTS. If handlers to request to be removed as signals
-occur, they will be serviced 1, MAX, MAX-1, ..., 2. This is because
-of a ReactorEx bookkeeping optimization.
-
-. test_reactorEx.cpp --
-
-This test application tests a wide range of events that can be
-demultiplexed using various ACE utilities. Events used include ^C
-events, reading from STDIN, vanilla Win32 events, thread exits,
-ReactorEx notifications, proactive reads, and proactive writes.
-
-The proactive I/O events are demultiplexed by the ACE_Proactor. The
-thread exits, notications, and vanilla Win32 events are demultiplexed
-by the ACE_ReactorEx. To enable a single thread to run all these
-events, the Proactor is integrated with the ReactorEx.
-
-The test application prototypes a simple ntalk program. Two instances
-of the application connect. Input from either console is displayed on
-the others console also. Because of the evils of Win32 STDIN, a
-separate thread is used to read from STDIN. To test the Proactor and
-ReactorEx, I/O between the remote processes is performed proactively
-and interactions between the STDIN thread and the main thread are
-performed reactively.
-
-The following description of the test application is in two parts.
-The participants section explains the main components involved in the
-application. The collaboration section describes how the partipants
-interact in response to the multiple event types which occur.
-
-The ReactorEx test application has the following participants:
-
-. ReactorEx -- The ReactorEx demultiplexes Win32 "waitable" events
- using WaitForMultipleObjects.
-
-. Proactor -- The proactor initiates and demultiplexes overlapped I/O
- operations. The Proactor registers with the ReactorEx so that a
- single-thread can demultiplex all application events.
-
-. STDIN_Handler -- STDIN_Handler is an Active Object which reads from
- STDIN and forwards the input to the Peer_Handler. This runs
- in a separate thread to make the test more interesting. However,
- STDIN is "waitable", so in general it can be waited on by the ACE
- ReactorEx, thanks MicroSlush!
-
-. Peer_Handler -- The Peer_Handler connects to another instance of
- test_reactorEx. It Proactively reads and writes data to the peer.
- When the STDIN_Handler gives it messages, it fowards them to the
- remote peer. When it receives messages from the remote peer, it
- prints the output to the console.
-
-The collaborations of the participants are as follows:
-
-. Initialization
-
- Peer_Handler -- connects to the remote peer. It then begins
- proactively reading from the remote connection. Note that it will
- be notified by the Proactor when a read completes. It also
- registers a new_msg_event with the ReactorEx. Note that when the
- new_msg_event is signaled (by the STDIN_Handler),
- Peer_Handler::handle_signal will get called.
-
- STDIN_Handler -- STDIN_Handler registers a signal handler for
- SIGINT. This just captures the exception so that the kernel doesn't
- kill our process; We want to exit gracefully. It also creates an
- Exit_Hook object which registers the STDIN_Handler's thread handle
- with the ReactorEx. The Exit_Hook will get called back when the
- STDIN_Handler thread exits. After registering these, it blocks
- reading from STDIN.
-
- Proactor -- is registered with the ReactorEx.
-
- The main thread of control waits in the ReactorEx.
-
-. STDIN events -- When the STDIN_Handler thread reads from STDIN, it
- puts the message on Peer_Handler's message queue and signals the
- new_msg_event. It then returns to reading from STDIN.
-
-. new_msg_events -- The ReactorEx thread wakes up and calls
- Peer_Handler::handle_signal. The Peer_Handler then tries to dequeue
- a message from its message queue. If it can, the message is
- Proactively sent to the remote peer. Note that the Peer_Handler
- will be notified with this operation is complete. The Peer_Handler
- then falls back into the ReactorEx event loop.
-
-. Send complete event -- When a proactive send is complete, the
- Proactor is notified by the ReactorEx. The Proactor, in turn,
- notifies the Peer_Handler. The Peer_Handler then checks for more
- messages from the message queue. If there are any, it tries to send
- them. If there are not, it returns to the ReactorEx event loop.
- This is ok since it is notified via new_msg_event when new message
- arrive.
-
-. Read complete event -- When a proactive read is complete (the
- Peer_Handler initiated a proactive read when it connected to the
- remote peer), the Proactor is notified by the ReactorEx. The
- Proactor, in turn notifies the Peer_Handler. If the read was
- successful the Peer_Handler just displays the received msg to the
- console and reinvokes a proactive read from the network connection.
- If the read failed (i.e. the remote peer exited), the Peer_Handler
- sets a flag to end the event loop and returns. This will cause the
- application to exit.
-
-. ^C events -- When the user types ^C at the console, the
- STDIN_Handler's signal handler will be called. It does nothing, but
- as a result of the signal, the STDIN_Handler thread will exit.
-
-. STDIN_Handler thread exits -- The Exit_Hook will get called back
- from the ReactorEx. Exit_Hook::handle_signal sets a flag to end the
- event loop and returns. This will cause the application to exit.
diff --git a/examples/Reactor/ReactorEx/reactorex.mak b/examples/Reactor/ReactorEx/reactorex.mak
index b64c91567d2..3c2b0893973 100644
--- a/examples/Reactor/ReactorEx/reactorex.mak
+++ b/examples/Reactor/ReactorEx/reactorex.mak
@@ -4,33 +4,34 @@
# TARGTYPE "Win32 (x86) Console Application" 0x0103
!IF "$(CFG)" == ""
-CFG=network - Win32 Debug
-!MESSAGE No configuration specified. Defaulting to network - Win32 Debug.
+CFG=Timeouts - Win32 Debug
+!MESSAGE No configuration specified. Defaulting to Timeouts - Win32 Debug.
!ENDIF
-!IF "$(CFG)" != "ntalk - Win32 Debug" && "$(CFG)" !=\
- "test_remove_handler - Win32 Debug" && "$(CFG)" != "test_timeout - Win32 Debug"\
- && "$(CFG)" != "test_MT - Win32 Debug" && "$(CFG)" !=\
- "test_exception - Win32 Debug" && "$(CFG)" != "simple - Win32 Debug" &&\
- "$(CFG)" != "network - Win32 Debug"
+!IF "$(CFG)" != "Exceptions - Win32 Debug" && "$(CFG)" !=\
+ "Multithreading - Win32 Debug" && "$(CFG)" != "Network_Events - Win32 Debug" &&\
+ "$(CFG)" != "Registration - Win32 Debug" && "$(CFG)" !=\
+ "Removals - Win32 Debug" && "$(CFG)" != "Talker - Win32 Debug" && "$(CFG)" !=\
+ "Timeouts - Win32 Debug"
!MESSAGE Invalid configuration "$(CFG)" specified.
!MESSAGE You can specify a configuration when running NMAKE on this makefile
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
-!MESSAGE NMAKE /f "reactorex.mak" CFG="network - Win32 Debug"
+!MESSAGE NMAKE /f "ReactorEx.mak" CFG="Timeouts - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
-!MESSAGE "ntalk - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE "test_remove_handler - Win32 Debug" (based on\
+!MESSAGE "Exceptions - Win32 Debug" (based on\
"Win32 (x86) Console Application")
-!MESSAGE "test_timeout - Win32 Debug" (based on\
+!MESSAGE "Multithreading - Win32 Debug" (based on\
"Win32 (x86) Console Application")
-!MESSAGE "test_MT - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE "test_exception - Win32 Debug" (based on\
+!MESSAGE "Network_Events - Win32 Debug" (based on\
"Win32 (x86) Console Application")
-!MESSAGE "simple - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE "network - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE "Registration - Win32 Debug" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE "Removals - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE "Talker - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE "Timeouts - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE
!ERROR An invalid configuration is specified.
!ENDIF
@@ -42,34 +43,36 @@ NULL=nul
!ENDIF
################################################################################
# Begin Project
-# PROP Target_Last_Scanned "ntalk - Win32 Debug"
RSC=rc.exe
CPP=cl.exe
-!IF "$(CFG)" == "ntalk - Win32 Debug"
+!IF "$(CFG)" == "Exceptions - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "ntalk\Debug"
-# PROP BASE Intermediate_Dir "ntalk\Debug"
-# PROP BASE Target_Dir "ntalk"
+# PROP BASE Output_Dir "Exceptions\Debug"
+# PROP BASE Intermediate_Dir "Exceptions\Debug"
+# PROP BASE Target_Dir "Exceptions"
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
-# PROP Output_Dir ""
+# PROP Output_Dir "."
# PROP Intermediate_Dir "Debug"
-# PROP Target_Dir "ntalk"
-OUTDIR=.
+# PROP Target_Dir "Exceptions"
+OUTDIR=.\.
INTDIR=.\Debug
-ALL : "$(OUTDIR)\test_reactorEx.exe"
+ALL : "$(OUTDIR)\Exceptions.exe"
CLEAN :
- -@erase "$(INTDIR)\test_reactorEx.obj"
+ -@erase "$(INTDIR)\test_exceptions.obj"
-@erase "$(INTDIR)\vc40.idb"
-@erase "$(INTDIR)\vc40.pdb"
- -@erase "$(OUTDIR)\test_reactorEx.exe"
- -@erase "$(OUTDIR)\test_reactorEx.ilk"
- -@erase "$(OUTDIR)\test_reactorEx.pdb"
+ -@erase "$(OUTDIR)\Exceptions.exe"
+ -@erase "$(OUTDIR)\Exceptions.ilk"
+ -@erase "$(OUTDIR)\Exceptions.pdb"
+
+"$(OUTDIR)" :
+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
"$(INTDIR)" :
if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)"
@@ -83,49 +86,52 @@ CPP_SBRS=.\.
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
-BSC32_FLAGS=/nologo /o"$(OUTDIR)/ntalk.bsc"
+BSC32_FLAGS=/nologo /o"$(OUTDIR)/Exceptions.bsc"
BSC32_SBRS= \
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 /subsystem:console /debug /machine:I386
-# ADD LINK32 ace.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 /out:"test_reactorEx.exe"
-LINK32_FLAGS=ace.lib kernel32.lib user32.lib gdi32.lib winspool.lib\
+# ADD LINK32 aced.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
+LINK32_FLAGS=aced.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 /incremental:yes\
- /pdb:"$(OUTDIR)/test_reactorEx.pdb" /debug /machine:I386\
- /out:"$(OUTDIR)/test_reactorEx.exe"
+ /pdb:"$(OUTDIR)/Exceptions.pdb" /debug /machine:I386\
+ /out:"$(OUTDIR)/Exceptions.exe"
LINK32_OBJS= \
- "$(INTDIR)\test_reactorEx.obj"
+ "$(INTDIR)\test_exceptions.obj"
-"$(OUTDIR)\test_reactorEx.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
+"$(OUTDIR)\Exceptions.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
$(LINK32) @<<
$(LINK32_FLAGS) $(LINK32_OBJS)
<<
-!ELSEIF "$(CFG)" == "test_remove_handler - Win32 Debug"
+!ELSEIF "$(CFG)" == "Multithreading - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "test_remove_handler\Debug"
-# PROP BASE Intermediate_Dir "test_remove_handler\Debug"
-# PROP BASE Target_Dir "test_remove_handler"
+# PROP BASE Output_Dir "Multithreading\Debug"
+# PROP BASE Intermediate_Dir "Multithreading\Debug"
+# PROP BASE Target_Dir "Multithreading"
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
-# PROP Output_Dir ""
+# PROP Output_Dir "."
# PROP Intermediate_Dir "Debug"
-# PROP Target_Dir "test_remove_handler"
-OUTDIR=.
+# PROP Target_Dir "Multithreading"
+OUTDIR=.\.
INTDIR=.\Debug
-ALL : "$(OUTDIR)\test_remove_handler.exe"
+ALL : "$(OUTDIR)\Multithreading.exe"
CLEAN :
- -@erase "$(INTDIR)\test_remove_handler.obj"
+ -@erase "$(INTDIR)\test_multithreading.obj"
-@erase "$(INTDIR)\vc40.idb"
-@erase "$(INTDIR)\vc40.pdb"
- -@erase "$(OUTDIR)\test_remove_handler.exe"
- -@erase "$(OUTDIR)\test_remove_handler.ilk"
- -@erase "$(OUTDIR)\test_remove_handler.pdb"
+ -@erase "$(OUTDIR)\Multithreading.exe"
+ -@erase "$(OUTDIR)\Multithreading.ilk"
+ -@erase "$(OUTDIR)\Multithreading.pdb"
+
+"$(OUTDIR)" :
+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
"$(INTDIR)" :
if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)"
@@ -139,49 +145,52 @@ CPP_SBRS=.\.
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
-BSC32_FLAGS=/nologo /o"$(OUTDIR)/test_remove_handler.bsc"
+BSC32_FLAGS=/nologo /o"$(OUTDIR)/Multithreading.bsc"
BSC32_SBRS= \
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 /subsystem:console /debug /machine:I386
-# ADD LINK32 ace.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
-LINK32_FLAGS=ace.lib kernel32.lib user32.lib gdi32.lib winspool.lib\
+# ADD LINK32 aced.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
+LINK32_FLAGS=aced.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 /incremental:yes\
- /pdb:"$(OUTDIR)/test_remove_handler.pdb" /debug /machine:I386\
- /out:"$(OUTDIR)/test_remove_handler.exe"
+ /pdb:"$(OUTDIR)/Multithreading.pdb" /debug /machine:I386\
+ /out:"$(OUTDIR)/Multithreading.exe"
LINK32_OBJS= \
- "$(INTDIR)\test_remove_handler.obj"
+ "$(INTDIR)\test_multithreading.obj"
-"$(OUTDIR)\test_remove_handler.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
+"$(OUTDIR)\Multithreading.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
$(LINK32) @<<
$(LINK32_FLAGS) $(LINK32_OBJS)
<<
-!ELSEIF "$(CFG)" == "test_timeout - Win32 Debug"
+!ELSEIF "$(CFG)" == "Network_Events - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "test_timeout\Debug"
-# PROP BASE Intermediate_Dir "test_timeout\Debug"
-# PROP BASE Target_Dir "test_timeout"
+# PROP BASE Output_Dir "Network_Events\Debug"
+# PROP BASE Intermediate_Dir "Network_Events\Debug"
+# PROP BASE Target_Dir "Network_Events"
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
-# PROP Output_Dir ""
+# PROP Output_Dir "."
# PROP Intermediate_Dir "Debug"
-# PROP Target_Dir "test_timeout"
-OUTDIR=.
+# PROP Target_Dir "Network_Events"
+OUTDIR=.\.
INTDIR=.\Debug
-ALL : "$(OUTDIR)\test_timeout.exe"
+ALL : "$(OUTDIR)\Network_Events.exe"
CLEAN :
- -@erase "$(INTDIR)\test_timeout.obj"
+ -@erase "$(INTDIR)\test_network_events.obj"
-@erase "$(INTDIR)\vc40.idb"
-@erase "$(INTDIR)\vc40.pdb"
- -@erase "$(OUTDIR)\test_timeout.exe"
- -@erase "$(OUTDIR)\test_timeout.ilk"
- -@erase "$(OUTDIR)\test_timeout.pdb"
+ -@erase "$(OUTDIR)\Network_Events.exe"
+ -@erase "$(OUTDIR)\Network_Events.ilk"
+ -@erase "$(OUTDIR)\Network_Events.pdb"
+
+"$(OUTDIR)" :
+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
"$(INTDIR)" :
if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)"
@@ -195,49 +204,52 @@ CPP_SBRS=.\.
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
-BSC32_FLAGS=/nologo /o"$(OUTDIR)/test_timeout.bsc"
+BSC32_FLAGS=/nologo /o"$(OUTDIR)/Network_Events.bsc"
BSC32_SBRS= \
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 /subsystem:console /debug /machine:I386
-# ADD LINK32 ace.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
-LINK32_FLAGS=ace.lib kernel32.lib user32.lib gdi32.lib winspool.lib\
+# ADD LINK32 aced.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
+LINK32_FLAGS=aced.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 /incremental:yes\
- /pdb:"$(OUTDIR)/test_timeout.pdb" /debug /machine:I386\
- /out:"$(OUTDIR)/test_timeout.exe"
+ /pdb:"$(OUTDIR)/Network_Events.pdb" /debug /machine:I386\
+ /out:"$(OUTDIR)/Network_Events.exe"
LINK32_OBJS= \
- "$(INTDIR)\test_timeout.obj"
+ "$(INTDIR)\test_network_events.obj"
-"$(OUTDIR)\test_timeout.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
+"$(OUTDIR)\Network_Events.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
$(LINK32) @<<
$(LINK32_FLAGS) $(LINK32_OBJS)
<<
-!ELSEIF "$(CFG)" == "test_MT - Win32 Debug"
+!ELSEIF "$(CFG)" == "Registration - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "test_MT\Debug"
-# PROP BASE Intermediate_Dir "test_MT\Debug"
-# PROP BASE Target_Dir "test_MT"
+# PROP BASE Output_Dir "Registration\Debug"
+# PROP BASE Intermediate_Dir "Registration\Debug"
+# PROP BASE Target_Dir "Registration"
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
-# PROP Output_Dir ""
+# PROP Output_Dir "."
# PROP Intermediate_Dir "Debug"
-# PROP Target_Dir "test_MT"
-OUTDIR=.
+# PROP Target_Dir "Registration"
+OUTDIR=.\.
INTDIR=.\Debug
-ALL : "$(OUTDIR)\test_MT.exe"
+ALL : "$(OUTDIR)\Registration.exe"
CLEAN :
- -@erase "$(INTDIR)\test_MT.obj"
+ -@erase "$(INTDIR)\test_registration.obj"
-@erase "$(INTDIR)\vc40.idb"
-@erase "$(INTDIR)\vc40.pdb"
- -@erase "$(OUTDIR)\test_MT.exe"
- -@erase "$(OUTDIR)\test_MT.ilk"
- -@erase "$(OUTDIR)\test_MT.pdb"
+ -@erase "$(OUTDIR)\Registration.exe"
+ -@erase "$(OUTDIR)\Registration.ilk"
+ -@erase "$(OUTDIR)\Registration.pdb"
+
+"$(OUTDIR)" :
+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
"$(INTDIR)" :
if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)"
@@ -251,48 +263,49 @@ CPP_SBRS=.\.
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
-BSC32_FLAGS=/nologo /o"$(OUTDIR)/test_MT.bsc"
+BSC32_FLAGS=/nologo /o"$(OUTDIR)/Registration.bsc"
BSC32_SBRS= \
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 /subsystem:console /debug /machine:I386
-# ADD LINK32 ace.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
-LINK32_FLAGS=ace.lib kernel32.lib user32.lib gdi32.lib winspool.lib\
+# ADD LINK32 aced.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
+LINK32_FLAGS=aced.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 /incremental:yes\
- /pdb:"$(OUTDIR)/test_MT.pdb" /debug /machine:I386 /out:"$(OUTDIR)/test_MT.exe"
+ /pdb:"$(OUTDIR)/Registration.pdb" /debug /machine:I386\
+ /out:"$(OUTDIR)/Registration.exe"
LINK32_OBJS= \
- "$(INTDIR)\test_MT.obj"
+ "$(INTDIR)\test_registration.obj"
-"$(OUTDIR)\test_MT.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
+"$(OUTDIR)\Registration.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
$(LINK32) @<<
$(LINK32_FLAGS) $(LINK32_OBJS)
<<
-!ELSEIF "$(CFG)" == "test_exception - Win32 Debug"
+!ELSEIF "$(CFG)" == "Removals - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "test_exception\Debug"
-# PROP BASE Intermediate_Dir "test_exception\Debug"
-# PROP BASE Target_Dir "test_exception"
+# PROP BASE Output_Dir "Removals\Debug"
+# PROP BASE Intermediate_Dir "Removals\Debug"
+# PROP BASE Target_Dir "Removals"
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "."
# PROP Intermediate_Dir "Debug"
-# PROP Target_Dir "test_exception"
+# PROP Target_Dir "Removals"
OUTDIR=.\.
INTDIR=.\Debug
-ALL : "$(OUTDIR)\test_exception.exe"
+ALL : "$(OUTDIR)\Removals.exe"
CLEAN :
- -@erase "$(INTDIR)\test_exceptions.obj"
+ -@erase "$(INTDIR)\test_removals.obj"
-@erase "$(INTDIR)\vc40.idb"
-@erase "$(INTDIR)\vc40.pdb"
- -@erase "$(OUTDIR)\test_exception.exe"
- -@erase "$(OUTDIR)\test_exception.ilk"
- -@erase "$(OUTDIR)\test_exception.pdb"
+ -@erase "$(OUTDIR)\Removals.exe"
+ -@erase "$(OUTDIR)\Removals.ilk"
+ -@erase "$(OUTDIR)\Removals.pdb"
"$(OUTDIR)" :
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
@@ -309,49 +322,49 @@ CPP_SBRS=.\.
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
-BSC32_FLAGS=/nologo /o"$(OUTDIR)/test_exception.bsc"
+BSC32_FLAGS=/nologo /o"$(OUTDIR)/Removals.bsc"
BSC32_SBRS= \
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 /subsystem:console /debug /machine:I386
-# ADD LINK32 ace.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
-LINK32_FLAGS=ace.lib kernel32.lib user32.lib gdi32.lib winspool.lib\
+# ADD LINK32 aced.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
+LINK32_FLAGS=aced.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 /incremental:yes\
- /pdb:"$(OUTDIR)/test_exception.pdb" /debug /machine:I386\
- /out:"$(OUTDIR)/test_exception.exe"
+ /pdb:"$(OUTDIR)/Removals.pdb" /debug /machine:I386\
+ /out:"$(OUTDIR)/Removals.exe"
LINK32_OBJS= \
- "$(INTDIR)\test_exceptions.obj"
+ "$(INTDIR)\test_removals.obj"
-"$(OUTDIR)\test_exception.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
+"$(OUTDIR)\Removals.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
$(LINK32) @<<
$(LINK32_FLAGS) $(LINK32_OBJS)
<<
-!ELSEIF "$(CFG)" == "simple - Win32 Debug"
+!ELSEIF "$(CFG)" == "Talker - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "simple\Debug"
-# PROP BASE Intermediate_Dir "simple\Debug"
-# PROP BASE Target_Dir "simple"
+# PROP BASE Output_Dir "Talker\Debug"
+# PROP BASE Intermediate_Dir "Talker\Debug"
+# PROP BASE Target_Dir "Talker"
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "."
# PROP Intermediate_Dir "Debug"
-# PROP Target_Dir "simple"
+# PROP Target_Dir "Talker"
OUTDIR=.\.
INTDIR=.\Debug
-ALL : "$(OUTDIR)\simple.exe"
+ALL : "$(OUTDIR)\Talker.exe"
CLEAN :
- -@erase "$(INTDIR)\simple_test.obj"
+ -@erase "$(INTDIR)\test_talker.obj"
-@erase "$(INTDIR)\vc40.idb"
-@erase "$(INTDIR)\vc40.pdb"
- -@erase "$(OUTDIR)\simple.exe"
- -@erase "$(OUTDIR)\simple.ilk"
- -@erase "$(OUTDIR)\simple.pdb"
+ -@erase "$(OUTDIR)\Talker.exe"
+ -@erase "$(OUTDIR)\Talker.ilk"
+ -@erase "$(OUTDIR)\Talker.pdb"
"$(OUTDIR)" :
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
@@ -368,48 +381,48 @@ CPP_SBRS=.\.
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
-BSC32_FLAGS=/nologo /o"$(OUTDIR)/simple.bsc"
+BSC32_FLAGS=/nologo /o"$(OUTDIR)/Talker.bsc"
BSC32_SBRS= \
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 /subsystem:console /debug /machine:I386
-# ADD LINK32 ace.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
-LINK32_FLAGS=ace.lib kernel32.lib user32.lib gdi32.lib winspool.lib\
+# ADD LINK32 aced.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
+LINK32_FLAGS=aced.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 /incremental:yes\
- /pdb:"$(OUTDIR)/simple.pdb" /debug /machine:I386 /out:"$(OUTDIR)/simple.exe"
+ /pdb:"$(OUTDIR)/Talker.pdb" /debug /machine:I386 /out:"$(OUTDIR)/Talker.exe"
LINK32_OBJS= \
- "$(INTDIR)\simple_test.obj"
+ "$(INTDIR)\test_talker.obj"
-"$(OUTDIR)\simple.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
+"$(OUTDIR)\Talker.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
$(LINK32) @<<
$(LINK32_FLAGS) $(LINK32_OBJS)
<<
-!ELSEIF "$(CFG)" == "network - Win32 Debug"
+!ELSEIF "$(CFG)" == "Timeouts - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "network\Debug"
-# PROP BASE Intermediate_Dir "network\Debug"
-# PROP BASE Target_Dir "network"
+# PROP BASE Output_Dir "Timeouts\Debug"
+# PROP BASE Intermediate_Dir "Timeouts\Debug"
+# PROP BASE Target_Dir "Timeouts"
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "."
# PROP Intermediate_Dir "Debug"
-# PROP Target_Dir "network"
+# PROP Target_Dir "Timeouts"
OUTDIR=.\.
INTDIR=.\Debug
-ALL : "$(OUTDIR)\network.exe"
+ALL : "$(OUTDIR)\Timeouts.exe"
CLEAN :
- -@erase "$(INTDIR)\network_test.obj"
+ -@erase "$(INTDIR)\test_timeouts.obj"
-@erase "$(INTDIR)\vc40.idb"
-@erase "$(INTDIR)\vc40.pdb"
- -@erase "$(OUTDIR)\network.exe"
- -@erase "$(OUTDIR)\network.ilk"
- -@erase "$(OUTDIR)\network.pdb"
+ -@erase "$(OUTDIR)\Timeouts.exe"
+ -@erase "$(OUTDIR)\Timeouts.ilk"
+ -@erase "$(OUTDIR)\Timeouts.pdb"
"$(OUTDIR)" :
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
@@ -426,20 +439,21 @@ CPP_SBRS=.\.
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
-BSC32_FLAGS=/nologo /o"$(OUTDIR)/network.bsc"
+BSC32_FLAGS=/nologo /o"$(OUTDIR)/Timeouts.bsc"
BSC32_SBRS= \
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 /subsystem:console /debug /machine:I386
-# ADD LINK32 ace.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
-LINK32_FLAGS=ace.lib kernel32.lib user32.lib gdi32.lib winspool.lib\
+# ADD LINK32 aced.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
+LINK32_FLAGS=aced.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 /incremental:yes\
- /pdb:"$(OUTDIR)/network.pdb" /debug /machine:I386 /out:"$(OUTDIR)/network.exe"
+ /pdb:"$(OUTDIR)/Timeouts.pdb" /debug /machine:I386\
+ /out:"$(OUTDIR)/Timeouts.exe"
LINK32_OBJS= \
- "$(INTDIR)\network_test.obj"
+ "$(INTDIR)\test_timeouts.obj"
-"$(OUTDIR)\network.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
+"$(OUTDIR)\Timeouts.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
$(LINK32) @<<
$(LINK32_FLAGS) $(LINK32_OBJS)
<<
@@ -447,7 +461,7 @@ LINK32_OBJS= \
!ENDIF
CPP_PROJ=/nologo /MDd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE"\
- /Fp"$(INTDIR)/ntalk.pch" /YX /Fo"$(INTDIR)/" /Fd"$(INTDIR)/" /c
+ /Fp"$(INTDIR)/Exceptions.pch" /YX /Fo"$(INTDIR)/" /Fd"$(INTDIR)/" /c
.c{$(CPP_OBJS)}.obj:
$(CPP) $(CPP_PROJ) $<
@@ -470,11 +484,11 @@ CPP_PROJ=/nologo /MDd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE"\
################################################################################
# Begin Target
-# Name "ntalk - Win32 Debug"
+# Name "Exceptions - Win32 Debug"
################################################################################
# Begin Source File
-SOURCE=.\test_reactorEx.cpp
+SOURCE=.\test_exceptions.cpp
DEP_CPP_TEST_=\
{$(INCLUDE)}"\ace\ACE.h"\
{$(INCLUDE)}"\ace\ACE.i"\
@@ -497,8 +511,6 @@ DEP_CPP_TEST_=\
{$(INCLUDE)}"\ace\Free_List.cpp"\
{$(INCLUDE)}"\ace\Free_List.h"\
{$(INCLUDE)}"\ace\Free_List.i"\
- {$(INCLUDE)}"\ace\Get_Opt.h"\
- {$(INCLUDE)}"\ace\Get_Opt.i"\
{$(INCLUDE)}"\ace\Handle_Set.h"\
{$(INCLUDE)}"\ace\Handle_Set.i"\
{$(INCLUDE)}"\ace\Hash_Map_Manager.cpp"\
@@ -533,9 +545,8 @@ DEP_CPP_TEST_=\
{$(INCLUDE)}"\ace\Message_Queue.cpp"\
{$(INCLUDE)}"\ace\Message_Queue.h"\
{$(INCLUDE)}"\ace\Message_Queue.i"\
- {$(INCLUDE)}"\ace\Module.cpp"\
- {$(INCLUDE)}"\ace\Module.h"\
- {$(INCLUDE)}"\ace\Module.i"\
+ {$(INCLUDE)}"\ace\Object_Manager.h"\
+ {$(INCLUDE)}"\ace\Object_Manager.i"\
{$(INCLUDE)}"\ace\OS.h"\
{$(INCLUDE)}"\ace\OS.i"\
{$(INCLUDE)}"\ace\Pipe.h"\
@@ -556,10 +567,6 @@ DEP_CPP_TEST_=\
{$(INCLUDE)}"\ace\Signal.i"\
{$(INCLUDE)}"\ace\SOCK.h"\
{$(INCLUDE)}"\ace\SOCK.i"\
- {$(INCLUDE)}"\ace\SOCK_Acceptor.h"\
- {$(INCLUDE)}"\ace\SOCK_Acceptor.i"\
- {$(INCLUDE)}"\ace\SOCK_Connector.h"\
- {$(INCLUDE)}"\ace\SOCK_Connector.i"\
{$(INCLUDE)}"\ace\SOCK_IO.h"\
{$(INCLUDE)}"\ace\SOCK_IO.i"\
{$(INCLUDE)}"\ace\SOCK_Stream.h"\
@@ -570,9 +577,6 @@ DEP_CPP_TEST_=\
{$(INCLUDE)}"\ace\Strategies.h"\
{$(INCLUDE)}"\ace\Strategies_T.cpp"\
{$(INCLUDE)}"\ace\Strategies_T.h"\
- {$(INCLUDE)}"\ace\Stream_Modules.cpp"\
- {$(INCLUDE)}"\ace\Stream_Modules.h"\
- {$(INCLUDE)}"\ace\Stream_Modules.i"\
{$(INCLUDE)}"\ace\SV_Semaphore_Complex.h"\
{$(INCLUDE)}"\ace\SV_Semaphore_Complex.i"\
{$(INCLUDE)}"\ace\SV_Semaphore_Simple.h"\
@@ -584,11 +588,6 @@ DEP_CPP_TEST_=\
{$(INCLUDE)}"\ace\Synch_T.cpp"\
{$(INCLUDE)}"\ace\Synch_T.h"\
{$(INCLUDE)}"\ace\Synch_T.i"\
- {$(INCLUDE)}"\ace\Task.h"\
- {$(INCLUDE)}"\ace\Task.i"\
- {$(INCLUDE)}"\ace\Task_T.cpp"\
- {$(INCLUDE)}"\ace\Task_T.h"\
- {$(INCLUDE)}"\ace\Task_T.i"\
{$(INCLUDE)}"\ace\Thread.h"\
{$(INCLUDE)}"\ace\Thread.i"\
{$(INCLUDE)}"\ace\Thread_Manager.h"\
@@ -613,7 +612,7 @@ DEP_CPP_TEST_=\
{$(INCLUDE)}"\ace\ws2tcpip.h"\
-"$(INTDIR)\test_reactorEx.obj" : $(SOURCE) $(DEP_CPP_TEST_) "$(INTDIR)"
+"$(INTDIR)\test_exceptions.obj" : $(SOURCE) $(DEP_CPP_TEST_) "$(INTDIR)"
# End Source File
@@ -621,12 +620,12 @@ DEP_CPP_TEST_=\
################################################################################
# Begin Target
-# Name "test_remove_handler - Win32 Debug"
+# Name "Multithreading - Win32 Debug"
################################################################################
# Begin Source File
-SOURCE=.\test_remove_handler.cpp
-DEP_CPP_TEST_R=\
+SOURCE=.\test_multithreading.cpp
+DEP_CPP_TEST_M=\
{$(INCLUDE)}"\ace\ACE.h"\
{$(INCLUDE)}"\ace\ACE.i"\
{$(INCLUDE)}"\ace\Addr.h"\
@@ -648,6 +647,8 @@ DEP_CPP_TEST_R=\
{$(INCLUDE)}"\ace\Free_List.cpp"\
{$(INCLUDE)}"\ace\Free_List.h"\
{$(INCLUDE)}"\ace\Free_List.i"\
+ {$(INCLUDE)}"\ace\Get_Opt.h"\
+ {$(INCLUDE)}"\ace\Get_Opt.i"\
{$(INCLUDE)}"\ace\Handle_Set.h"\
{$(INCLUDE)}"\ace\Handle_Set.i"\
{$(INCLUDE)}"\ace\Hash_Map_Manager.cpp"\
@@ -682,6 +683,11 @@ DEP_CPP_TEST_R=\
{$(INCLUDE)}"\ace\Message_Queue.cpp"\
{$(INCLUDE)}"\ace\Message_Queue.h"\
{$(INCLUDE)}"\ace\Message_Queue.i"\
+ {$(INCLUDE)}"\ace\Module.cpp"\
+ {$(INCLUDE)}"\ace\Module.h"\
+ {$(INCLUDE)}"\ace\Module.i"\
+ {$(INCLUDE)}"\ace\Object_Manager.h"\
+ {$(INCLUDE)}"\ace\Object_Manager.i"\
{$(INCLUDE)}"\ace\OS.h"\
{$(INCLUDE)}"\ace\OS.i"\
{$(INCLUDE)}"\ace\Pipe.h"\
@@ -712,6 +718,9 @@ DEP_CPP_TEST_R=\
{$(INCLUDE)}"\ace\Strategies.h"\
{$(INCLUDE)}"\ace\Strategies_T.cpp"\
{$(INCLUDE)}"\ace\Strategies_T.h"\
+ {$(INCLUDE)}"\ace\Stream_Modules.cpp"\
+ {$(INCLUDE)}"\ace\Stream_Modules.h"\
+ {$(INCLUDE)}"\ace\Stream_Modules.i"\
{$(INCLUDE)}"\ace\SV_Semaphore_Complex.h"\
{$(INCLUDE)}"\ace\SV_Semaphore_Complex.i"\
{$(INCLUDE)}"\ace\SV_Semaphore_Simple.h"\
@@ -723,6 +732,11 @@ DEP_CPP_TEST_R=\
{$(INCLUDE)}"\ace\Synch_T.cpp"\
{$(INCLUDE)}"\ace\Synch_T.h"\
{$(INCLUDE)}"\ace\Synch_T.i"\
+ {$(INCLUDE)}"\ace\Task.h"\
+ {$(INCLUDE)}"\ace\Task.i"\
+ {$(INCLUDE)}"\ace\Task_T.cpp"\
+ {$(INCLUDE)}"\ace\Task_T.h"\
+ {$(INCLUDE)}"\ace\Task_T.i"\
{$(INCLUDE)}"\ace\Thread.h"\
{$(INCLUDE)}"\ace\Thread.i"\
{$(INCLUDE)}"\ace\Thread_Manager.h"\
@@ -747,7 +761,7 @@ DEP_CPP_TEST_R=\
{$(INCLUDE)}"\ace\ws2tcpip.h"\
-"$(INTDIR)\test_remove_handler.obj" : $(SOURCE) $(DEP_CPP_TEST_R) "$(INTDIR)"
+"$(INTDIR)\test_multithreading.obj" : $(SOURCE) $(DEP_CPP_TEST_M) "$(INTDIR)"
# End Source File
@@ -755,12 +769,12 @@ DEP_CPP_TEST_R=\
################################################################################
# Begin Target
-# Name "test_timeout - Win32 Debug"
+# Name "Network_Events - Win32 Debug"
################################################################################
# Begin Source File
-SOURCE=.\test_timeout.cpp
-DEP_CPP_TEST_T=\
+SOURCE=.\test_network_events.cpp
+DEP_CPP_TEST_N=\
{$(INCLUDE)}"\ace\ACE.h"\
{$(INCLUDE)}"\ace\ACE.i"\
{$(INCLUDE)}"\ace\Addr.h"\
@@ -816,6 +830,8 @@ DEP_CPP_TEST_T=\
{$(INCLUDE)}"\ace\Message_Queue.cpp"\
{$(INCLUDE)}"\ace\Message_Queue.h"\
{$(INCLUDE)}"\ace\Message_Queue.i"\
+ {$(INCLUDE)}"\ace\Object_Manager.h"\
+ {$(INCLUDE)}"\ace\Object_Manager.i"\
{$(INCLUDE)}"\ace\OS.h"\
{$(INCLUDE)}"\ace\OS.i"\
{$(INCLUDE)}"\ace\Pipe.h"\
@@ -836,6 +852,8 @@ DEP_CPP_TEST_T=\
{$(INCLUDE)}"\ace\Signal.i"\
{$(INCLUDE)}"\ace\SOCK.h"\
{$(INCLUDE)}"\ace\SOCK.i"\
+ {$(INCLUDE)}"\ace\SOCK_Acceptor.h"\
+ {$(INCLUDE)}"\ace\SOCK_Acceptor.i"\
{$(INCLUDE)}"\ace\SOCK_IO.h"\
{$(INCLUDE)}"\ace\SOCK_IO.i"\
{$(INCLUDE)}"\ace\SOCK_Stream.h"\
@@ -881,7 +899,7 @@ DEP_CPP_TEST_T=\
{$(INCLUDE)}"\ace\ws2tcpip.h"\
-"$(INTDIR)\test_timeout.obj" : $(SOURCE) $(DEP_CPP_TEST_T) "$(INTDIR)"
+"$(INTDIR)\test_network_events.obj" : $(SOURCE) $(DEP_CPP_TEST_N) "$(INTDIR)"
# End Source File
@@ -889,12 +907,12 @@ DEP_CPP_TEST_T=\
################################################################################
# Begin Target
-# Name "test_MT - Win32 Debug"
+# Name "Registration - Win32 Debug"
################################################################################
# Begin Source File
-SOURCE=.\test_MT.cpp
-DEP_CPP_TEST_M=\
+SOURCE=.\test_registration.cpp
+DEP_CPP_TEST_R=\
{$(INCLUDE)}"\ace\ACE.h"\
{$(INCLUDE)}"\ace\ACE.i"\
{$(INCLUDE)}"\ace\Addr.h"\
@@ -916,8 +934,6 @@ DEP_CPP_TEST_M=\
{$(INCLUDE)}"\ace\Free_List.cpp"\
{$(INCLUDE)}"\ace\Free_List.h"\
{$(INCLUDE)}"\ace\Free_List.i"\
- {$(INCLUDE)}"\ace\Get_Opt.h"\
- {$(INCLUDE)}"\ace\Get_Opt.i"\
{$(INCLUDE)}"\ace\Handle_Set.h"\
{$(INCLUDE)}"\ace\Handle_Set.i"\
{$(INCLUDE)}"\ace\Hash_Map_Manager.cpp"\
@@ -952,9 +968,8 @@ DEP_CPP_TEST_M=\
{$(INCLUDE)}"\ace\Message_Queue.cpp"\
{$(INCLUDE)}"\ace\Message_Queue.h"\
{$(INCLUDE)}"\ace\Message_Queue.i"\
- {$(INCLUDE)}"\ace\Module.cpp"\
- {$(INCLUDE)}"\ace\Module.h"\
- {$(INCLUDE)}"\ace\Module.i"\
+ {$(INCLUDE)}"\ace\Object_Manager.h"\
+ {$(INCLUDE)}"\ace\Object_Manager.i"\
{$(INCLUDE)}"\ace\OS.h"\
{$(INCLUDE)}"\ace\OS.i"\
{$(INCLUDE)}"\ace\Pipe.h"\
@@ -985,9 +1000,6 @@ DEP_CPP_TEST_M=\
{$(INCLUDE)}"\ace\Strategies.h"\
{$(INCLUDE)}"\ace\Strategies_T.cpp"\
{$(INCLUDE)}"\ace\Strategies_T.h"\
- {$(INCLUDE)}"\ace\Stream_Modules.cpp"\
- {$(INCLUDE)}"\ace\Stream_Modules.h"\
- {$(INCLUDE)}"\ace\Stream_Modules.i"\
{$(INCLUDE)}"\ace\SV_Semaphore_Complex.h"\
{$(INCLUDE)}"\ace\SV_Semaphore_Complex.i"\
{$(INCLUDE)}"\ace\SV_Semaphore_Simple.h"\
@@ -999,11 +1011,6 @@ DEP_CPP_TEST_M=\
{$(INCLUDE)}"\ace\Synch_T.cpp"\
{$(INCLUDE)}"\ace\Synch_T.h"\
{$(INCLUDE)}"\ace\Synch_T.i"\
- {$(INCLUDE)}"\ace\Task.h"\
- {$(INCLUDE)}"\ace\Task.i"\
- {$(INCLUDE)}"\ace\Task_T.cpp"\
- {$(INCLUDE)}"\ace\Task_T.h"\
- {$(INCLUDE)}"\ace\Task_T.i"\
{$(INCLUDE)}"\ace\Thread.h"\
{$(INCLUDE)}"\ace\Thread.i"\
{$(INCLUDE)}"\ace\Thread_Manager.h"\
@@ -1028,7 +1035,7 @@ DEP_CPP_TEST_M=\
{$(INCLUDE)}"\ace\ws2tcpip.h"\
-"$(INTDIR)\test_MT.obj" : $(SOURCE) $(DEP_CPP_TEST_M) "$(INTDIR)"
+"$(INTDIR)\test_registration.obj" : $(SOURCE) $(DEP_CPP_TEST_R) "$(INTDIR)"
# End Source File
@@ -1036,12 +1043,12 @@ DEP_CPP_TEST_M=\
################################################################################
# Begin Target
-# Name "test_exception - Win32 Debug"
+# Name "Removals - Win32 Debug"
################################################################################
# Begin Source File
-SOURCE=.\test_exceptions.cpp
-DEP_CPP_TEST_E=\
+SOURCE=.\test_removals.cpp
+DEP_CPP_TEST_RE=\
{$(INCLUDE)}"\ace\ACE.h"\
{$(INCLUDE)}"\ace\ACE.i"\
{$(INCLUDE)}"\ace\Addr.h"\
@@ -1097,6 +1104,8 @@ DEP_CPP_TEST_E=\
{$(INCLUDE)}"\ace\Message_Queue.cpp"\
{$(INCLUDE)}"\ace\Message_Queue.h"\
{$(INCLUDE)}"\ace\Message_Queue.i"\
+ {$(INCLUDE)}"\ace\Object_Manager.h"\
+ {$(INCLUDE)}"\ace\Object_Manager.i"\
{$(INCLUDE)}"\ace\OS.h"\
{$(INCLUDE)}"\ace\OS.i"\
{$(INCLUDE)}"\ace\Pipe.h"\
@@ -1162,7 +1171,7 @@ DEP_CPP_TEST_E=\
{$(INCLUDE)}"\ace\ws2tcpip.h"\
-"$(INTDIR)\test_exceptions.obj" : $(SOURCE) $(DEP_CPP_TEST_E) "$(INTDIR)"
+"$(INTDIR)\test_removals.obj" : $(SOURCE) $(DEP_CPP_TEST_RE) "$(INTDIR)"
# End Source File
@@ -1170,12 +1179,12 @@ DEP_CPP_TEST_E=\
################################################################################
# Begin Target
-# Name "simple - Win32 Debug"
+# Name "Talker - Win32 Debug"
################################################################################
# Begin Source File
-SOURCE=.\simple_test.cpp
-DEP_CPP_SIMPL=\
+SOURCE=.\test_talker.cpp
+DEP_CPP_TEST_T=\
{$(INCLUDE)}"\ace\ACE.h"\
{$(INCLUDE)}"\ace\ACE.i"\
{$(INCLUDE)}"\ace\Addr.h"\
@@ -1197,6 +1206,8 @@ DEP_CPP_SIMPL=\
{$(INCLUDE)}"\ace\Free_List.cpp"\
{$(INCLUDE)}"\ace\Free_List.h"\
{$(INCLUDE)}"\ace\Free_List.i"\
+ {$(INCLUDE)}"\ace\Get_Opt.h"\
+ {$(INCLUDE)}"\ace\Get_Opt.i"\
{$(INCLUDE)}"\ace\Handle_Set.h"\
{$(INCLUDE)}"\ace\Handle_Set.i"\
{$(INCLUDE)}"\ace\Hash_Map_Manager.cpp"\
@@ -1231,6 +1242,11 @@ DEP_CPP_SIMPL=\
{$(INCLUDE)}"\ace\Message_Queue.cpp"\
{$(INCLUDE)}"\ace\Message_Queue.h"\
{$(INCLUDE)}"\ace\Message_Queue.i"\
+ {$(INCLUDE)}"\ace\Module.cpp"\
+ {$(INCLUDE)}"\ace\Module.h"\
+ {$(INCLUDE)}"\ace\Module.i"\
+ {$(INCLUDE)}"\ace\Object_Manager.h"\
+ {$(INCLUDE)}"\ace\Object_Manager.i"\
{$(INCLUDE)}"\ace\OS.h"\
{$(INCLUDE)}"\ace\OS.i"\
{$(INCLUDE)}"\ace\Pipe.h"\
@@ -1251,6 +1267,10 @@ DEP_CPP_SIMPL=\
{$(INCLUDE)}"\ace\Signal.i"\
{$(INCLUDE)}"\ace\SOCK.h"\
{$(INCLUDE)}"\ace\SOCK.i"\
+ {$(INCLUDE)}"\ace\SOCK_Acceptor.h"\
+ {$(INCLUDE)}"\ace\SOCK_Acceptor.i"\
+ {$(INCLUDE)}"\ace\SOCK_Connector.h"\
+ {$(INCLUDE)}"\ace\SOCK_Connector.i"\
{$(INCLUDE)}"\ace\SOCK_IO.h"\
{$(INCLUDE)}"\ace\SOCK_IO.i"\
{$(INCLUDE)}"\ace\SOCK_Stream.h"\
@@ -1261,6 +1281,9 @@ DEP_CPP_SIMPL=\
{$(INCLUDE)}"\ace\Strategies.h"\
{$(INCLUDE)}"\ace\Strategies_T.cpp"\
{$(INCLUDE)}"\ace\Strategies_T.h"\
+ {$(INCLUDE)}"\ace\Stream_Modules.cpp"\
+ {$(INCLUDE)}"\ace\Stream_Modules.h"\
+ {$(INCLUDE)}"\ace\Stream_Modules.i"\
{$(INCLUDE)}"\ace\SV_Semaphore_Complex.h"\
{$(INCLUDE)}"\ace\SV_Semaphore_Complex.i"\
{$(INCLUDE)}"\ace\SV_Semaphore_Simple.h"\
@@ -1272,6 +1295,11 @@ DEP_CPP_SIMPL=\
{$(INCLUDE)}"\ace\Synch_T.cpp"\
{$(INCLUDE)}"\ace\Synch_T.h"\
{$(INCLUDE)}"\ace\Synch_T.i"\
+ {$(INCLUDE)}"\ace\Task.h"\
+ {$(INCLUDE)}"\ace\Task.i"\
+ {$(INCLUDE)}"\ace\Task_T.cpp"\
+ {$(INCLUDE)}"\ace\Task_T.h"\
+ {$(INCLUDE)}"\ace\Task_T.i"\
{$(INCLUDE)}"\ace\Thread.h"\
{$(INCLUDE)}"\ace\Thread.i"\
{$(INCLUDE)}"\ace\Thread_Manager.h"\
@@ -1296,7 +1324,7 @@ DEP_CPP_SIMPL=\
{$(INCLUDE)}"\ace\ws2tcpip.h"\
-"$(INTDIR)\simple_test.obj" : $(SOURCE) $(DEP_CPP_SIMPL) "$(INTDIR)"
+"$(INTDIR)\test_talker.obj" : $(SOURCE) $(DEP_CPP_TEST_T) "$(INTDIR)"
# End Source File
@@ -1304,12 +1332,12 @@ DEP_CPP_SIMPL=\
################################################################################
# Begin Target
-# Name "network - Win32 Debug"
+# Name "Timeouts - Win32 Debug"
################################################################################
# Begin Source File
-SOURCE=.\network_test.cpp
-DEP_CPP_NETWO=\
+SOURCE=.\test_timeouts.cpp
+DEP_CPP_TEST_TI=\
{$(INCLUDE)}"\ace\ACE.h"\
{$(INCLUDE)}"\ace\ACE.i"\
{$(INCLUDE)}"\ace\Addr.h"\
@@ -1365,6 +1393,8 @@ DEP_CPP_NETWO=\
{$(INCLUDE)}"\ace\Message_Queue.cpp"\
{$(INCLUDE)}"\ace\Message_Queue.h"\
{$(INCLUDE)}"\ace\Message_Queue.i"\
+ {$(INCLUDE)}"\ace\Object_Manager.h"\
+ {$(INCLUDE)}"\ace\Object_Manager.i"\
{$(INCLUDE)}"\ace\OS.h"\
{$(INCLUDE)}"\ace\OS.i"\
{$(INCLUDE)}"\ace\Pipe.h"\
@@ -1385,8 +1415,6 @@ DEP_CPP_NETWO=\
{$(INCLUDE)}"\ace\Signal.i"\
{$(INCLUDE)}"\ace\SOCK.h"\
{$(INCLUDE)}"\ace\SOCK.i"\
- {$(INCLUDE)}"\ace\SOCK_Acceptor.h"\
- {$(INCLUDE)}"\ace\SOCK_Acceptor.i"\
{$(INCLUDE)}"\ace\SOCK_IO.h"\
{$(INCLUDE)}"\ace\SOCK_IO.i"\
{$(INCLUDE)}"\ace\SOCK_Stream.h"\
@@ -1432,7 +1460,7 @@ DEP_CPP_NETWO=\
{$(INCLUDE)}"\ace\ws2tcpip.h"\
-"$(INTDIR)\network_test.obj" : $(SOURCE) $(DEP_CPP_NETWO) "$(INTDIR)"
+"$(INTDIR)\test_timeouts.obj" : $(SOURCE) $(DEP_CPP_TEST_TI) "$(INTDIR)"
# End Source File
diff --git a/examples/Reactor/ReactorEx/reactorex.mdp b/examples/Reactor/ReactorEx/reactorex.mdp
index 8abb3eb3924..402dd6a5352 100644
--- a/examples/Reactor/ReactorEx/reactorex.mdp
+++ b/examples/Reactor/ReactorEx/reactorex.mdp
Binary files differ
diff --git a/examples/Reactor/ReactorEx/test_exceptions.cpp b/examples/Reactor/ReactorEx/test_exceptions.cpp
index f399d34a393..7a975ec1d12 100644
--- a/examples/Reactor/ReactorEx/test_exceptions.cpp
+++ b/examples/Reactor/ReactorEx/test_exceptions.cpp
@@ -1,3 +1,28 @@
+// $Id$
+//
+// ============================================================================
+//
+// = LIBRARY
+// examples
+//
+// = FILENAME
+// test_exceptions.cpp
+//
+// = DESCRIPTION
+//
+// This test application tests the state of ReactorEx when
+// exceptions occurs when executing user callbacks.
+//
+// The thread count in ReactorEx is used to ensure that state of
+// ReactorEx is not fouled up when exceptions occur in user code.
+// This example also shows how to write event loops that survive
+// user exceptions
+//
+// = AUTHOR
+// Irfan Pyarali
+//
+// ============================================================================
+
#include "ace/ReactorEx.h"
class Event_Handler : public ACE_Event_Handler
@@ -52,11 +77,9 @@ public:
int
main (int, char *[])
{
- Event_Handler *handler;
- ACE_NEW_RETURN (handler, Event_Handler, -1);
- ACE_ReactorEx::instance ()->register_handler (handler);
+ Event_Handler handler;
+ ACE_ReactorEx::instance ()->register_handler (&handler);
ACE_ReactorEx_Test::doit ();
- delete handler;
return 0;
}
diff --git a/examples/Reactor/WFMO_Reactor/test_MT.cpp b/examples/Reactor/ReactorEx/test_multithreading.cpp
index 5d346880938..01fccc19350 100644
--- a/examples/Reactor/WFMO_Reactor/test_MT.cpp
+++ b/examples/Reactor/ReactorEx/test_multithreading.cpp
@@ -1,10 +1,12 @@
+// $Id$
+//
// ============================================================================
//
// = LIBRARY
// examples
//
// = FILENAME
-// test_MT.cpp
+// test_multithreading.cpp
//
// = DESCRIPTION
// This application tests multiple threads simultaneously calling
@@ -121,7 +123,7 @@ Task_Handler::Task_Handler (size_t number_of_handles,
for (size_t i = 0; i < number_of_handles; i++)
{
if (ACE_ReactorEx::instance ()->register_handler (this,
- this->events_[i].handle ()) == -1)
+ this->events_[i].handle ()) == -1)
ACE_ERROR ((LM_ERROR, "%p\t cannot register handle %d with ReactorEx\n",
"Task_Handler::Task_Handler", i));
}
@@ -147,14 +149,14 @@ Task_Handler::handle_signal (int signum, siginfo_t *siginfo, ucontext_t *)
siginfo->si_handle_));
if (ACE_ReactorEx::instance ()->remove_handler (siginfo->si_handle_,
- ACE_Event_Handler::DONT_CALL) == -1)
+ ACE_Event_Handler::DONT_CALL) == -1)
ACE_ERROR_RETURN ((LM_ERROR,
"(%t) %p\tTask cannot be unregistered from ReactorEx: handle value = %d\n",
"Task_Handler::handle_signal",
siginfo->si_handle_), -1);
if (ACE_ReactorEx::instance ()->register_handler (this,
- siginfo->si_handle_) == -1)
+ siginfo->si_handle_) == -1)
ACE_ERROR_RETURN ((LM_ERROR,
"(%t) %p\tTask cannot be registered with ReactorEx: handle value = %d\n",
"Task_Handler::handle_signal",
@@ -209,8 +211,8 @@ main (int argc, char **argv)
// Setup a timer for the task
if (ACE_ReactorEx::instance ()->schedule_timer (&task,
- (void *) i,
- 0) == -1)
+ (void *) i,
+ 0) == -1)
ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "schedule_timer"), -1);
for (int i = 0; i < number_of_handles_to_signal; i++)
diff --git a/examples/Reactor/ReactorEx/test_network_events.cpp b/examples/Reactor/ReactorEx/test_network_events.cpp
new file mode 100644
index 00000000000..bfe63baed1b
--- /dev/null
+++ b/examples/Reactor/ReactorEx/test_network_events.cpp
@@ -0,0 +1,183 @@
+// $Id$
+//
+// ============================================================================
+//
+// = LIBRARY
+// examples
+//
+// = FILENAME
+// test_network_events.cpp
+//
+// = DESCRIPTION
+//
+// This application tests ReactorEx to make sure that it responds
+// correctly to different kinds of network events.
+//
+// The test starts off by creating a Network_Listener, that listens
+// for connections at ACE_DEFAULT_SERVER_PORT. When a client
+// connects, a Network_Handler is created. Network_Handler reads
+// messages off the socket and prints them out. This is done until
+// the remote side shuts down. Multiple clients can connect at the
+// same time.
+//
+// Events tested in this example includes ACCEPT, READ, and CLOSE masks.
+//
+// To run this example, start an instance of this example and
+// connect to it using telnet (to port
+// ACE_DEFAULT_SERVER_PORT(10002)).
+//
+// = AUTHOR
+// Irfan Pyarali
+//
+// ============================================================================
+
+#include "ace/ReactorEx.h"
+#include "ace/INET_Addr.h"
+#include "ace/SOCK_Stream.h"
+#include "ace/SOCK_Acceptor.h"
+
+// Globals for this test
+int stop_test = 0;
+ACE_ReactorEx reactorEx;
+
+class Network_Handler : public ACE_Event_Handler
+{
+public:
+ Network_Handler (ACE_SOCK_Stream &s);
+ // Default constructor
+
+ virtual int handle_input (ACE_HANDLE handle);
+ virtual int handle_close (ACE_HANDLE handle,
+ ACE_Reactor_Mask close_mask);
+ virtual ACE_HANDLE get_handle (void) const;
+
+ ACE_SOCK_Stream stream_;
+
+};
+
+Network_Handler::Network_Handler (ACE_SOCK_Stream &s)
+ : stream_ (s)
+{
+ this->reactorEx (&::reactorEx);
+
+ ACE_Reactor_Mask mask = ACE_Event_Handler::READ_MASK | ACE_Event_Handler::CLOSE_MASK;
+ ACE_ASSERT (this->reactorEx ()->register_handler (this,
+ mask) == 0);
+}
+
+ACE_HANDLE
+Network_Handler::get_handle (void) const
+{
+ return this->stream_.get_handle ();
+}
+
+int
+Network_Handler::handle_input (ACE_HANDLE handle)
+{
+ ACE_DEBUG ((LM_DEBUG, "Network_Handler::handle_input handle = %d\n", handle));
+
+ char message[BUFSIZ];
+ int result = this->stream_.recv (message, sizeof message);
+ if (result > 0)
+ {
+ message[result] = 0;
+ ACE_DEBUG ((LM_DEBUG, "Remote message: %s\n", message));
+ return 0;
+ }
+ else
+ {
+ ACE_DEBUG ((LM_DEBUG, "Problems in receiving data, result = %d", result));
+ return -1;
+ }
+}
+
+int
+Network_Handler::handle_close (ACE_HANDLE handle,
+ ACE_Reactor_Mask close_mask)
+{
+ ACE_DEBUG ((LM_DEBUG, "Network_Handler::handle_close handle = %d\n", handle));
+
+ // Called because of remote shutdown
+ if (close_mask == ACE_Event_Handler::CLOSE_MASK)
+ {
+ ACE_Reactor_Mask mask = ACE_Event_Handler::DONT_CALL | ACE_Event_Handler::ALL_EVENTS_MASK;
+ this->reactorEx ()->remove_handler (this, mask);
+ }
+
+ this->stream_.close ();
+
+ delete this;
+
+ return 0;
+}
+
+class Network_Listener : public ACE_Event_Handler
+{
+public:
+ Network_Listener (void);
+ // Default constructor
+
+ virtual int handle_input (ACE_HANDLE handle);
+ virtual int handle_close (ACE_HANDLE handle,
+ ACE_Reactor_Mask close_mask);
+ ACE_HANDLE get_handle (void) const;
+
+ ACE_INET_Addr local_address_;
+ ACE_SOCK_Acceptor acceptor_;
+};
+
+Network_Listener::Network_Listener (void)
+ : local_address_ (ACE_DEFAULT_SERVER_PORT),
+ acceptor_ (local_address_, 1)
+{
+ this->reactorEx (&::reactorEx);
+ ACE_ASSERT (this->reactorEx ()->register_handler (this,
+ ACE_Event_Handler::ACCEPT_MASK) == 0);
+}
+
+ACE_HANDLE
+Network_Listener::get_handle (void) const
+{
+ return this->acceptor_.get_handle ();
+}
+
+int
+Network_Listener::handle_input (ACE_HANDLE handle)
+{
+ ACE_DEBUG ((LM_DEBUG, "Network_Listener::handle_input handle = %d\n", handle));
+
+ ACE_INET_Addr remote_address;
+ ACE_SOCK_Stream stream;
+
+ ACE_ASSERT (this->acceptor_.accept (stream, &remote_address) == 0);
+
+ ACE_DEBUG ((LM_DEBUG, "Remote connection from: "));
+ remote_address.dump ();
+
+ Network_Handler *handler = new Network_Handler (stream);
+
+ return 0;
+}
+
+int
+Network_Listener::handle_close (ACE_HANDLE handle,
+ ACE_Reactor_Mask close_mask)
+{
+ ACE_DEBUG ((LM_DEBUG, "Network_Listener::handle_close handle = %d\n", handle));
+
+ this->acceptor_.close ();
+ return 0;
+}
+
+int
+main ()
+{
+ Network_Listener listener;
+
+ int result = 0;
+ while (!stop_test && result != -1)
+ {
+ result = reactorEx.handle_events ();
+ }
+ return 0;
+};
diff --git a/examples/Reactor/ReactorEx/test_registration.cpp b/examples/Reactor/ReactorEx/test_registration.cpp
new file mode 100644
index 00000000000..5184424771e
--- /dev/null
+++ b/examples/Reactor/ReactorEx/test_registration.cpp
@@ -0,0 +1,154 @@
+// $Id$
+//
+// ============================================================================
+//
+// = LIBRARY
+// examples
+//
+// = FILENAME
+// test_registration.cpp
+//
+// = DESCRIPTION
+//
+// This test application tests a wide range of registration,
+// suspension, resumption, and removal of events from ReactorEx.
+//
+// The application initially registers two events with ReactorEx. A
+// auxiliary thread is created to do the signaling on the
+// events. When the first event is signaled, the event is suspended
+// from ReactorEx. The event is then signaled again, but is "lost"
+// since the handler has been suspended. When the second event is
+// signal, the first event is resumed and the second is
+// suspended. When the first event is signaled again, both events
+// are removed from ReactorEx.
+//
+// This test shows off the following features of ReactorEx:
+// - Registration
+// - Suspension
+// - Resumption
+// - Removal (while active and while suspended)
+//
+// = AUTHOR
+// Irfan Pyarali
+//
+// ============================================================================
+
+#include "ace/ReactorEx.h"
+
+// Globals for this test
+int stop_test = 0;
+ACE_ReactorEx reactorEx;
+
+
+class Simple_Handler : public ACE_Event_Handler
+{
+public:
+ Simple_Handler (void);
+ // Default constructor
+
+ virtual int handle_signal (int signum, siginfo_t * = 0, ucontext_t * = 0);
+ virtual int handle_close (ACE_HANDLE handle,
+ ACE_Reactor_Mask close_mask);
+
+ ACE_Auto_Event event1_;
+ ACE_Auto_Event event2_;
+ int handle_signal_count_;
+ int handle_close_count_;
+};
+
+Simple_Handler::Simple_Handler (void)
+ : handle_signal_count_ (0),
+ handle_close_count_ (0)
+{
+}
+
+int
+Simple_Handler::handle_signal (int signum, siginfo_t *s, ucontext_t *)
+{
+ ACE_HANDLE handle = s->si_handle_;
+ ACE_DEBUG ((LM_DEBUG, "Simple_Handler::handle_signal handle = %d\n", handle));
+ this->handle_signal_count_++;
+
+ if (this->handle_signal_count_ == 1)
+ {
+ ACE_DEBUG ((LM_DEBUG, "suspending handle = %d\n", event1_.handle ()));
+ this->reactorEx ()->suspend_handler (event1_.handle ());
+ }
+ else if (this->handle_signal_count_ == 2)
+ {
+ ACE_DEBUG ((LM_DEBUG, "resuming handle = %d\n", event1_.handle ()));
+ this->reactorEx ()->resume_handler (event1_.handle ());
+ ACE_DEBUG ((LM_DEBUG, "suspending handle = %d\n", event2_.handle ()));
+ this->reactorEx ()->suspend_handler (event2_.handle ());
+ }
+ else if (this->handle_signal_count_ == 3)
+ {
+ ACE_DEBUG ((LM_DEBUG, "removing handle = %d\n", event1_.handle ()));
+ this->reactorEx ()->remove_handler (event1_.handle ());
+ ACE_DEBUG ((LM_DEBUG, "removing handle = %d\n", event2_.handle ()));
+ this->reactorEx ()->remove_handler (event2_.handle ());
+ }
+ return 0;
+}
+
+int
+Simple_Handler::handle_close (ACE_HANDLE handle,
+ ACE_Reactor_Mask close_mask)
+{
+ ACE_DEBUG ((LM_DEBUG, "Simple_Handler::handle_close handle = %d\n", handle));
+ this->handle_close_count_++;
+
+ if (this->handle_close_count_ == 1)
+ stop_test = 0;
+ else if (this->handle_close_count_ == 2)
+ stop_test = 1;
+
+ return 0;
+}
+
+// Globals for this test
+Simple_Handler simple_handler;
+
+void
+worker (void)
+{
+ ACE_DEBUG ((LM_DEBUG, "(%t) Thread creation\n"));
+ ACE_DEBUG ((LM_DEBUG, "(%t) Thread sleeping\n"));
+ ACE_OS::sleep (1);
+ ACE_DEBUG ((LM_DEBUG, "(%t) Thread signaling %d\n", simple_handler.event1_.handle()));
+ simple_handler.event1_.signal ();
+ ACE_DEBUG ((LM_DEBUG, "(%t) Thread sleeping\n"));
+ ACE_OS::sleep (1);
+ ACE_DEBUG ((LM_DEBUG, "(%t) Thread signaling %d\n", simple_handler.event1_.handle()));
+ ACE_DEBUG ((LM_DEBUG, "Note: This signal should be \"lost\" because of the suspended handler\n"));
+ simple_handler.event1_.signal ();
+ ACE_DEBUG ((LM_DEBUG, "(%t) Thread sleeping\n"));
+ ACE_OS::sleep (1);
+ ACE_DEBUG ((LM_DEBUG, "(%t) Thread resetting %d\n", simple_handler.event1_.handle()));
+ simple_handler.event1_.reset ();
+ ACE_DEBUG ((LM_DEBUG, "(%t) Thread signaling %d\n", simple_handler.event2_.handle()));
+ simple_handler.event2_.signal ();
+ ACE_DEBUG ((LM_DEBUG, "(%t) Thread sleeping\n"));
+ ACE_OS::sleep (1);
+ ACE_DEBUG ((LM_DEBUG, "(%t) Thread signaling %d\n", simple_handler.event1_.handle()));
+ simple_handler.event1_.signal ();
+ ACE_DEBUG ((LM_DEBUG, "(%t) Thread death\n"));
+}
+
+int
+main ()
+{
+ ACE_ASSERT (reactorEx.register_handler (&simple_handler,
+ simple_handler.event1_.handle ()) == 0);
+ ACE_ASSERT (reactorEx.register_handler (&simple_handler,
+ simple_handler.event2_.handle ()) == 0);
+
+ ACE_OS::thr_create ((ACE_THR_FUNC) worker, 0, 0, 0);
+
+ int result = 0;
+ while (!stop_test && result != -1)
+ {
+ result = reactorEx.handle_events ();
+ }
+ return 0;
+};
diff --git a/examples/Reactor/WFMO_Reactor/test_remove_handler.cpp b/examples/Reactor/ReactorEx/test_removals.cpp
index 5a8aa0e6649..fda33df704a 100644
--- a/examples/Reactor/WFMO_Reactor/test_remove_handler.cpp
+++ b/examples/Reactor/ReactorEx/test_removals.cpp
@@ -1,20 +1,22 @@
-// ============================================================================
// $Id$
-
+//
+// ============================================================================
//
// = LIBRARY
// examples
//
// = FILENAME
-// test_remove_handler.cpp
+// test_removals.cpp
//
// = DESCRIPTION
+//
// Tests the ReactorEx's ability to handle simultaneous events. If
// you pass anything on the command-line, then each handler
// requests to be removed from the ReactorEx after each event.
//
// = AUTHOR
// Tim Harrison
+// Irfan Pyarali
//
// ============================================================================
@@ -35,10 +37,10 @@ public:
Event_Handler (int event_number,
int close_down)
: event_number_ (event_number),
- close_down_ (close_down)
+ close_down_ (close_down)
{
if (ACE_ReactorEx::instance ()->register_handler (this,
- this->event_.handle ()) == -1)
+ this->event_.handle ()) == -1)
ACE_ERROR ((LM_ERROR, "%p\tevent handler %d cannot be added to ReactorEx\n", "", event_number_));
this->event_.signal ();
}
diff --git a/examples/Reactor/WFMO_Reactor/test_reactorEx.cpp b/examples/Reactor/ReactorEx/test_talker.cpp
index 5075437be94..7b2d53ca9b5 100644
--- a/examples/Reactor/WFMO_Reactor/test_reactorEx.cpp
+++ b/examples/Reactor/ReactorEx/test_talker.cpp
@@ -1,27 +1,134 @@
// $Id$
-
+//
// ============================================================================
//
// = LIBRARY
// examples
//
// = FILENAME
-// test_reactorEx.cpp
+// test_talker.cpp
//
// = DESCRIPTION
-// This test application tests a wide range of events that can be
-// demultiplexed using various ACE utilities. Events used include ^C
-// events, reading from STDIN, vanilla Win32 events, thread exits,
-// ReactorEx notifications, proactive reads, and proactive writes.
//
+// This test application tests a wide range of events that can be
+// demultiplexed using various ACE utilities. Events used include
+// ^C events, reading from STDIN, vanilla Win32 events, thread
+// exits, ReactorEx notifications, proactive reads, and proactive
+// writes.
+//
// The proactive I/O events are demultiplexed by the ACE_Proactor.
// The thread exits, notications, and vanilla Win32 events are
// demultiplexed by the ACE_ReactorEx. To enable a single thread
// to run all these events, the Proactor is integrated with the
// ReactorEx.
+//
+// The test application prototypes a simple talk program. Two
+// instances of the application connect. Input from either console
+// is displayed on the others console also. Because of the evils
+// of Win32 STDIN, a separate thread is used to read from STDIN.
+// To test the Proactor and ReactorEx, I/O between the remote
+// processes is performed proactively and interactions between the
+// STDIN thread and the main thread are performed reactively.
+//
+// The following description of the test application is in two
+// parts. The participants section explains the main components
+// involved in the application. The collaboration section
+// describes how the partipants interact in response to the
+// multiple event types which occur.
+//
+// The ReactorEx test application has the following participants:
+//
+// . ReactorEx -- The ReactorEx demultiplexes Win32 "waitable"
+// events using WaitForMultipleObjects.
+//
+// . Proactor -- The proactor initiates and demultiplexes
+// overlapped I/O operations. The Proactor registers with the
+// ReactorEx so that a single-thread can demultiplex all
+// application events.
+//
+// . STDIN_Handler -- STDIN_Handler is an Active Object which reads
+// from STDIN and forwards the input to the Peer_Handler. This
+// runs in a separate thread to make the test more interesting.
+// However, STDIN is "waitable", so in general it can be waited on
+// by the ACE ReactorEx, thanks MicroSlush!
+//
+// . Peer_Handler -- The Peer_Handler connects to another instance
+// of test_reactorEx. It Proactively reads and writes data to the
+// peer. When the STDIN_Handler gives it messages, it fowards them
+// to the remote peer. When it receives messages from the remote
+// peer, it prints the output to the console.
+//
+// The collaborations of the participants are as follows:
+//
+// . Initialization
+//
+// Peer_Handler -- connects to the remote peer. It then begins
+// proactively reading from the remote connection. Note that it
+// will be notified by the Proactor when a read completes. It
+// also registers a notification strategy with message queue so
+// that it is notified when the STDIN_Handler posts a message
+// onto the queue.
+//
+// STDIN_Handler -- STDIN_Handler registers a signal handler for
+// SIGINT. This just captures the exception so that the kernel
+// doesn't kill our process; We want to exit gracefully. It also
+// creates an Exit_Hook object which registers the
+// STDIN_Handler's thread handle with the ReactorEx. The
+// Exit_Hook will get called back when the STDIN_Handler thread
+// exits. After registering these, it blocks reading from STDIN.
+//
+// Proactor -- is registered with the ReactorEx.
+//
+// The main thread of control waits in the ReactorEx.
+//
+// . STDIN events -- When the STDIN_Handler thread reads from
+// STDIN, it puts the message on Peer_Handler's message queue. It
+// then returns to reading from STDIN.
+//
+// . Message enqueue -- The ReactorEx thread wakes up and calls
+// Peer_Handler::handle_output. The Peer_Handler then tries to
+// dequeue a message from its message queue. If it can, the
+// message is Proactively sent to the remote peer. Note that the
+// Peer_Handler will be notified with this operation is complete.
+// The Peer_Handler then falls back into the ReactorEx event loop.
+//
+// . Send complete event -- When a proactive send is complete, the
+// Proactor is notified by the ReactorEx. The Proactor, in turn,
+// notifies the Peer_Handler. The Peer_Handler then checks for
+// more messages from the message queue. If there are any, it
+// tries to send them. If there are not, it returns to the
+// ReactorEx event loop.
+//
+// . Read complete event -- When a proactive read is complete (the
+// Peer_Handler initiated a proactive read when it connected to the
+// remote peer), the Proactor is notified by the ReactorEx. The
+// Proactor, in turn notifies the Peer_Handler. If the read was
+// successful the Peer_Handler just displays the received msg to
+// the console and reinvokes a proactive read from the network
+// connection. If the read failed (i.e. the remote peer exited),
+// the Peer_Handler sets a flag to end the event loop and returns.
+// This will cause the application to exit.
+//
+// . ^C events -- When the user types ^C at the console, the
+// STDIN_Handler's signal handler will be called. It does nothing,
+// but as a result of the signal, the STDIN_Handler thread will
+// exit.
+//
+// . STDIN_Handler thread exits -- The Exit_Hook will get called
+// back from the ReactorEx. Exit_Hook::handle_signal sets a flag
+// to end the event loop and returns. This will cause the
+// application to exit.
+//
+//
+// To run example, start an instance of the test with an optional
+// local port argument (as the acceptor). Start the other instance
+// with -h <hostname> and -p <server port>. Type in either the
+// client or server windows and your message should show up in the
+// other window. Control C to exit.
//
// = AUTHOR
-// Tim Harrison
+// Tim Harrison
+// Irfan Pyarali
//
// ============================================================================
@@ -37,9 +144,9 @@
typedef ACE_Task<ACE_MT_SYNCH> MT_TASK;
class Peer_Handler : public MT_TASK, public ACE_Handler
- // = TITLE
- // Connect to a server. Receive messages from STDIN_Handler
- // and forward them to the server using proactive I/O.
+// = TITLE
+// Connect to a server. Receive messages from STDIN_Handler
+// and forward them to the server using proactive I/O.
{
public:
// = Initialization methods.
@@ -101,9 +208,9 @@ private:
};
class STDIN_Handler : public ACE_Task<ACE_NULL_SYNCH>
- // = TITLE
- // Active Object. Reads from STDIN and passes message blocks to
- // the peer handler.
+// = TITLE
+// Active Object. Reads from STDIN and passes message blocks to
+// the peer handler.
{
public:
STDIN_Handler (MT_TASK &ph);
@@ -155,15 +262,15 @@ Peer_Handler::Peer_Handler (int argc, char *argv[])
while ((c = get_opt ()) != EOF)
{
- switch (c)
- {
- case 'h':
- host_ = get_opt.optarg;
- break;
- case 'p':
- port_ = ACE_OS::atoi (get_opt.optarg);
- break;
- }
+ switch (c)
+ {
+ case 'h':
+ host_ = get_opt.optarg;
+ break;
+ case 'p':
+ port_ = ACE_OS::atoi (get_opt.optarg);
+ break;
+ }
}
}
diff --git a/examples/Reactor/ReactorEx/test_timeout.cpp b/examples/Reactor/ReactorEx/test_timeouts.cpp
index c176c330856..ce5925ac679 100644
--- a/examples/Reactor/ReactorEx/test_timeout.cpp
+++ b/examples/Reactor/ReactorEx/test_timeouts.cpp
@@ -1,25 +1,30 @@
-// $Id: test_timeout.cpp
-
+// $Id$
+//
// ============================================================================
//
// = LIBRARY
// examples
//
// = FILENAME
-// test_timeout.cpp
+// test_timeouts.cpp
//
// = DESCRIPTION
-// This example application shows how to write ReactorEx and
-// Proactor event loops that handle events for some fixed amount of
-// time.
+//
+// This example application shows how to write ReactorEx event
+// loops that handle events for some fixed amount of time.
+//
+// Run this example (without arguments) to see the timers
+// expire. The order should be:
+//
+// foo, bar, foo, bar, foo, foo, bar, foo, bar, foo
//
// = AUTHOR
// Tim Harrison
+// Irfan Pyarali
//
// ============================================================================
#include "ace/ReactorEx.h"
-#include "ace/Proactor.h"
#include "ace/Service_Config.h"
#include "ace/OS.h"
@@ -51,19 +56,19 @@ main (int, char *[])
{
Timeout_Handler handler;
- // Register a 2 second timer.
- ACE_Time_Value foo_tv (2);
- ACE_ReactorEx::instance ()->schedule_timer (&handler,
- (void *) "Foo",
- ACE_Time_Value::zero,
- foo_tv);
// Register a 3 second timer.
ACE_Time_Value bar_tv (3);
ACE_ReactorEx::instance ()->schedule_timer (&handler,
- (void *) "Bar",
- ACE_Time_Value::zero,
- bar_tv);
+ (void *) "Bar",
+ bar_tv,
+ bar_tv);
+ // Register a 2 second timer.
+ ACE_Time_Value foo_tv (2);
+ ACE_ReactorEx::instance ()->schedule_timer (&handler,
+ (void *) "Foo",
+ foo_tv,
+ foo_tv);
// Handle events for 12 seconds.
ACE_Time_Value run_time (12);
if (ACE_ReactorEx::run_event_loop(run_time) == -1)
diff --git a/examples/Reactor/WFMO_Reactor/README b/examples/Reactor/WFMO_Reactor/README
deleted file mode 100644
index 429899b9132..00000000000
--- a/examples/Reactor/WFMO_Reactor/README
+++ /dev/null
@@ -1,224 +0,0 @@
-The ACE_ReactorEx encapsulates the Win32 WaitForMultipleObjects() API
-within ACE. The ACE_ReactorEx is similar in spirit to the
-ACE_Reactor, except that (1) it is much simpler and (2) it works for
-the complete range of Win32 handles (whereas the ACE_Reactor just
-works for socket handles.
-
-Here's the API for the ACE_ReactorEx:
-
-class ACE_ReactorEx
-{
-public:
- // = Event loop.
- virtual int handle_events (ACE_Time_Value *);
-
- // = Handler registration management.
- virtual int register_handler (ACE_Event_Handler *);
- virtual int remove_handler (ACE_Event_Handler *);
-
- virtual int notify (void);
-
- // = Timer management
- virtual int schedule_timer (), etc.
- // ...
-};
-
-----------------------------------------
-
-Here's how you might use it:
-
-----------------------------------------
-
-class My_Thread_Handler : public ACE_Event_Handler
-{
-public:
- My_Thread_Handler (void) {
- // Create a thread that will run
- // for a time and then exit.
- this->thread_handle_ =
- ACE_OS::thr_create (run, ......);
- }
-
- // Called back by the ACE_ReactorEx when the
- // event is signaled.
- virtual int handle_signal (int)
- {
- cout << "thread is done" << endl;
- }
-
- virtual ACE_HANDLE get_handle (void) const
- {
- return this->thread_handle_;
- }
-
-private:
- ACE_HANDLE thread_handle_;
-
- static void *run (void *) {
- // Sleep for a while and then exit.
- ACE_OS::sleep (100000);
- return 0;
- }
-};
-
-----------------------------------------
-
-The main program might look something like this:
-
-----------------------------------------
-
-int main (void)
-{
- // ...
- ACE_ReactorEx dispatcher;
- My_Thread_Handler handler;
-
- // Register the thread handler.
- dispatcher.register_handler (&handler);
-
- // Block until the thread exits and the
- // handle_signal() method of the My_Thread_Handler
- // is called!
- dispatcher.handle_events ();
-
- // ...
-}
-
-----------------------------------------
-
-. test_timeout --
-
-This example application shows how to write ReactorEx and Proactor
-event loops that handle events for some fixed amount of time. It uses
-ACE_ReactorEx::run_event_loop(run_time) to handle
-events for run_time seconds. The output should be the following:
-
-1 timeout occurred for Foo.
-2 timeout occurred for Bar.
-3 timeout occurred for Foo.
-4 timeout occurred for Bar.
-5 timeout occurred for Foo.
-6 timeout occurred for Bar.
-7 timeout occurred for Foo.
-8 timeout occurred for Foo.
-9 timeout occurred for Bar.
-10 timeout occurred for Foo.
-11 timeout occurred for Bar.
-12 timeout occurred for Foo.
-
-. test_remove_handler --
-
-This application tests the ReactorEx's ability to handle simultaneous
-events. If you pass anything on the command-line, then each handler
-requests to be removed from the ReactorEx after each event. This has
-a funky effect on the order in which handlers are serviced. So, if no
-parameters are passed in, the handlers should be serviced 1 through
-MAXIMUM_WAIT_OBJECTS. If handlers to request to be removed as signals
-occur, they will be serviced 1, MAX, MAX-1, ..., 2. This is because
-of a ReactorEx bookkeeping optimization.
-
-. test_reactorEx.cpp --
-
-This test application tests a wide range of events that can be
-demultiplexed using various ACE utilities. Events used include ^C
-events, reading from STDIN, vanilla Win32 events, thread exits,
-ReactorEx notifications, proactive reads, and proactive writes.
-
-The proactive I/O events are demultiplexed by the ACE_Proactor. The
-thread exits, notications, and vanilla Win32 events are demultiplexed
-by the ACE_ReactorEx. To enable a single thread to run all these
-events, the Proactor is integrated with the ReactorEx.
-
-The test application prototypes a simple ntalk program. Two instances
-of the application connect. Input from either console is displayed on
-the others console also. Because of the evils of Win32 STDIN, a
-separate thread is used to read from STDIN. To test the Proactor and
-ReactorEx, I/O between the remote processes is performed proactively
-and interactions between the STDIN thread and the main thread are
-performed reactively.
-
-The following description of the test application is in two parts.
-The participants section explains the main components involved in the
-application. The collaboration section describes how the partipants
-interact in response to the multiple event types which occur.
-
-The ReactorEx test application has the following participants:
-
-. ReactorEx -- The ReactorEx demultiplexes Win32 "waitable" events
- using WaitForMultipleObjects.
-
-. Proactor -- The proactor initiates and demultiplexes overlapped I/O
- operations. The Proactor registers with the ReactorEx so that a
- single-thread can demultiplex all application events.
-
-. STDIN_Handler -- STDIN_Handler is an Active Object which reads from
- STDIN and forwards the input to the Peer_Handler. This runs
- in a separate thread to make the test more interesting. However,
- STDIN is "waitable", so in general it can be waited on by the ACE
- ReactorEx, thanks MicroSlush!
-
-. Peer_Handler -- The Peer_Handler connects to another instance of
- test_reactorEx. It Proactively reads and writes data to the peer.
- When the STDIN_Handler gives it messages, it fowards them to the
- remote peer. When it receives messages from the remote peer, it
- prints the output to the console.
-
-The collaborations of the participants are as follows:
-
-. Initialization
-
- Peer_Handler -- connects to the remote peer. It then begins
- proactively reading from the remote connection. Note that it will
- be notified by the Proactor when a read completes. It also
- registers a new_msg_event with the ReactorEx. Note that when the
- new_msg_event is signaled (by the STDIN_Handler),
- Peer_Handler::handle_signal will get called.
-
- STDIN_Handler -- STDIN_Handler registers a signal handler for
- SIGINT. This just captures the exception so that the kernel doesn't
- kill our process; We want to exit gracefully. It also creates an
- Exit_Hook object which registers the STDIN_Handler's thread handle
- with the ReactorEx. The Exit_Hook will get called back when the
- STDIN_Handler thread exits. After registering these, it blocks
- reading from STDIN.
-
- Proactor -- is registered with the ReactorEx.
-
- The main thread of control waits in the ReactorEx.
-
-. STDIN events -- When the STDIN_Handler thread reads from STDIN, it
- puts the message on Peer_Handler's message queue and signals the
- new_msg_event. It then returns to reading from STDIN.
-
-. new_msg_events -- The ReactorEx thread wakes up and calls
- Peer_Handler::handle_signal. The Peer_Handler then tries to dequeue
- a message from its message queue. If it can, the message is
- Proactively sent to the remote peer. Note that the Peer_Handler
- will be notified with this operation is complete. The Peer_Handler
- then falls back into the ReactorEx event loop.
-
-. Send complete event -- When a proactive send is complete, the
- Proactor is notified by the ReactorEx. The Proactor, in turn,
- notifies the Peer_Handler. The Peer_Handler then checks for more
- messages from the message queue. If there are any, it tries to send
- them. If there are not, it returns to the ReactorEx event loop.
- This is ok since it is notified via new_msg_event when new message
- arrive.
-
-. Read complete event -- When a proactive read is complete (the
- Peer_Handler initiated a proactive read when it connected to the
- remote peer), the Proactor is notified by the ReactorEx. The
- Proactor, in turn notifies the Peer_Handler. If the read was
- successful the Peer_Handler just displays the received msg to the
- console and reinvokes a proactive read from the network connection.
- If the read failed (i.e. the remote peer exited), the Peer_Handler
- sets a flag to end the event loop and returns. This will cause the
- application to exit.
-
-. ^C events -- When the user types ^C at the console, the
- STDIN_Handler's signal handler will be called. It does nothing, but
- as a result of the signal, the STDIN_Handler thread will exit.
-
-. STDIN_Handler thread exits -- The Exit_Hook will get called back
- from the ReactorEx. Exit_Hook::handle_signal sets a flag to end the
- event loop and returns. This will cause the application to exit.
diff --git a/examples/Reactor/WFMO_Reactor/reactorex.mak b/examples/Reactor/WFMO_Reactor/reactorex.mak
index b64c91567d2..3c2b0893973 100644
--- a/examples/Reactor/WFMO_Reactor/reactorex.mak
+++ b/examples/Reactor/WFMO_Reactor/reactorex.mak
@@ -4,33 +4,34 @@
# TARGTYPE "Win32 (x86) Console Application" 0x0103
!IF "$(CFG)" == ""
-CFG=network - Win32 Debug
-!MESSAGE No configuration specified. Defaulting to network - Win32 Debug.
+CFG=Timeouts - Win32 Debug
+!MESSAGE No configuration specified. Defaulting to Timeouts - Win32 Debug.
!ENDIF
-!IF "$(CFG)" != "ntalk - Win32 Debug" && "$(CFG)" !=\
- "test_remove_handler - Win32 Debug" && "$(CFG)" != "test_timeout - Win32 Debug"\
- && "$(CFG)" != "test_MT - Win32 Debug" && "$(CFG)" !=\
- "test_exception - Win32 Debug" && "$(CFG)" != "simple - Win32 Debug" &&\
- "$(CFG)" != "network - Win32 Debug"
+!IF "$(CFG)" != "Exceptions - Win32 Debug" && "$(CFG)" !=\
+ "Multithreading - Win32 Debug" && "$(CFG)" != "Network_Events - Win32 Debug" &&\
+ "$(CFG)" != "Registration - Win32 Debug" && "$(CFG)" !=\
+ "Removals - Win32 Debug" && "$(CFG)" != "Talker - Win32 Debug" && "$(CFG)" !=\
+ "Timeouts - Win32 Debug"
!MESSAGE Invalid configuration "$(CFG)" specified.
!MESSAGE You can specify a configuration when running NMAKE on this makefile
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
-!MESSAGE NMAKE /f "reactorex.mak" CFG="network - Win32 Debug"
+!MESSAGE NMAKE /f "ReactorEx.mak" CFG="Timeouts - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
-!MESSAGE "ntalk - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE "test_remove_handler - Win32 Debug" (based on\
+!MESSAGE "Exceptions - Win32 Debug" (based on\
"Win32 (x86) Console Application")
-!MESSAGE "test_timeout - Win32 Debug" (based on\
+!MESSAGE "Multithreading - Win32 Debug" (based on\
"Win32 (x86) Console Application")
-!MESSAGE "test_MT - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE "test_exception - Win32 Debug" (based on\
+!MESSAGE "Network_Events - Win32 Debug" (based on\
"Win32 (x86) Console Application")
-!MESSAGE "simple - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE "network - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE "Registration - Win32 Debug" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE "Removals - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE "Talker - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE "Timeouts - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE
!ERROR An invalid configuration is specified.
!ENDIF
@@ -42,34 +43,36 @@ NULL=nul
!ENDIF
################################################################################
# Begin Project
-# PROP Target_Last_Scanned "ntalk - Win32 Debug"
RSC=rc.exe
CPP=cl.exe
-!IF "$(CFG)" == "ntalk - Win32 Debug"
+!IF "$(CFG)" == "Exceptions - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "ntalk\Debug"
-# PROP BASE Intermediate_Dir "ntalk\Debug"
-# PROP BASE Target_Dir "ntalk"
+# PROP BASE Output_Dir "Exceptions\Debug"
+# PROP BASE Intermediate_Dir "Exceptions\Debug"
+# PROP BASE Target_Dir "Exceptions"
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
-# PROP Output_Dir ""
+# PROP Output_Dir "."
# PROP Intermediate_Dir "Debug"
-# PROP Target_Dir "ntalk"
-OUTDIR=.
+# PROP Target_Dir "Exceptions"
+OUTDIR=.\.
INTDIR=.\Debug
-ALL : "$(OUTDIR)\test_reactorEx.exe"
+ALL : "$(OUTDIR)\Exceptions.exe"
CLEAN :
- -@erase "$(INTDIR)\test_reactorEx.obj"
+ -@erase "$(INTDIR)\test_exceptions.obj"
-@erase "$(INTDIR)\vc40.idb"
-@erase "$(INTDIR)\vc40.pdb"
- -@erase "$(OUTDIR)\test_reactorEx.exe"
- -@erase "$(OUTDIR)\test_reactorEx.ilk"
- -@erase "$(OUTDIR)\test_reactorEx.pdb"
+ -@erase "$(OUTDIR)\Exceptions.exe"
+ -@erase "$(OUTDIR)\Exceptions.ilk"
+ -@erase "$(OUTDIR)\Exceptions.pdb"
+
+"$(OUTDIR)" :
+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
"$(INTDIR)" :
if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)"
@@ -83,49 +86,52 @@ CPP_SBRS=.\.
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
-BSC32_FLAGS=/nologo /o"$(OUTDIR)/ntalk.bsc"
+BSC32_FLAGS=/nologo /o"$(OUTDIR)/Exceptions.bsc"
BSC32_SBRS= \
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 /subsystem:console /debug /machine:I386
-# ADD LINK32 ace.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 /out:"test_reactorEx.exe"
-LINK32_FLAGS=ace.lib kernel32.lib user32.lib gdi32.lib winspool.lib\
+# ADD LINK32 aced.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
+LINK32_FLAGS=aced.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 /incremental:yes\
- /pdb:"$(OUTDIR)/test_reactorEx.pdb" /debug /machine:I386\
- /out:"$(OUTDIR)/test_reactorEx.exe"
+ /pdb:"$(OUTDIR)/Exceptions.pdb" /debug /machine:I386\
+ /out:"$(OUTDIR)/Exceptions.exe"
LINK32_OBJS= \
- "$(INTDIR)\test_reactorEx.obj"
+ "$(INTDIR)\test_exceptions.obj"
-"$(OUTDIR)\test_reactorEx.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
+"$(OUTDIR)\Exceptions.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
$(LINK32) @<<
$(LINK32_FLAGS) $(LINK32_OBJS)
<<
-!ELSEIF "$(CFG)" == "test_remove_handler - Win32 Debug"
+!ELSEIF "$(CFG)" == "Multithreading - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "test_remove_handler\Debug"
-# PROP BASE Intermediate_Dir "test_remove_handler\Debug"
-# PROP BASE Target_Dir "test_remove_handler"
+# PROP BASE Output_Dir "Multithreading\Debug"
+# PROP BASE Intermediate_Dir "Multithreading\Debug"
+# PROP BASE Target_Dir "Multithreading"
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
-# PROP Output_Dir ""
+# PROP Output_Dir "."
# PROP Intermediate_Dir "Debug"
-# PROP Target_Dir "test_remove_handler"
-OUTDIR=.
+# PROP Target_Dir "Multithreading"
+OUTDIR=.\.
INTDIR=.\Debug
-ALL : "$(OUTDIR)\test_remove_handler.exe"
+ALL : "$(OUTDIR)\Multithreading.exe"
CLEAN :
- -@erase "$(INTDIR)\test_remove_handler.obj"
+ -@erase "$(INTDIR)\test_multithreading.obj"
-@erase "$(INTDIR)\vc40.idb"
-@erase "$(INTDIR)\vc40.pdb"
- -@erase "$(OUTDIR)\test_remove_handler.exe"
- -@erase "$(OUTDIR)\test_remove_handler.ilk"
- -@erase "$(OUTDIR)\test_remove_handler.pdb"
+ -@erase "$(OUTDIR)\Multithreading.exe"
+ -@erase "$(OUTDIR)\Multithreading.ilk"
+ -@erase "$(OUTDIR)\Multithreading.pdb"
+
+"$(OUTDIR)" :
+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
"$(INTDIR)" :
if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)"
@@ -139,49 +145,52 @@ CPP_SBRS=.\.
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
-BSC32_FLAGS=/nologo /o"$(OUTDIR)/test_remove_handler.bsc"
+BSC32_FLAGS=/nologo /o"$(OUTDIR)/Multithreading.bsc"
BSC32_SBRS= \
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 /subsystem:console /debug /machine:I386
-# ADD LINK32 ace.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
-LINK32_FLAGS=ace.lib kernel32.lib user32.lib gdi32.lib winspool.lib\
+# ADD LINK32 aced.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
+LINK32_FLAGS=aced.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 /incremental:yes\
- /pdb:"$(OUTDIR)/test_remove_handler.pdb" /debug /machine:I386\
- /out:"$(OUTDIR)/test_remove_handler.exe"
+ /pdb:"$(OUTDIR)/Multithreading.pdb" /debug /machine:I386\
+ /out:"$(OUTDIR)/Multithreading.exe"
LINK32_OBJS= \
- "$(INTDIR)\test_remove_handler.obj"
+ "$(INTDIR)\test_multithreading.obj"
-"$(OUTDIR)\test_remove_handler.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
+"$(OUTDIR)\Multithreading.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
$(LINK32) @<<
$(LINK32_FLAGS) $(LINK32_OBJS)
<<
-!ELSEIF "$(CFG)" == "test_timeout - Win32 Debug"
+!ELSEIF "$(CFG)" == "Network_Events - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "test_timeout\Debug"
-# PROP BASE Intermediate_Dir "test_timeout\Debug"
-# PROP BASE Target_Dir "test_timeout"
+# PROP BASE Output_Dir "Network_Events\Debug"
+# PROP BASE Intermediate_Dir "Network_Events\Debug"
+# PROP BASE Target_Dir "Network_Events"
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
-# PROP Output_Dir ""
+# PROP Output_Dir "."
# PROP Intermediate_Dir "Debug"
-# PROP Target_Dir "test_timeout"
-OUTDIR=.
+# PROP Target_Dir "Network_Events"
+OUTDIR=.\.
INTDIR=.\Debug
-ALL : "$(OUTDIR)\test_timeout.exe"
+ALL : "$(OUTDIR)\Network_Events.exe"
CLEAN :
- -@erase "$(INTDIR)\test_timeout.obj"
+ -@erase "$(INTDIR)\test_network_events.obj"
-@erase "$(INTDIR)\vc40.idb"
-@erase "$(INTDIR)\vc40.pdb"
- -@erase "$(OUTDIR)\test_timeout.exe"
- -@erase "$(OUTDIR)\test_timeout.ilk"
- -@erase "$(OUTDIR)\test_timeout.pdb"
+ -@erase "$(OUTDIR)\Network_Events.exe"
+ -@erase "$(OUTDIR)\Network_Events.ilk"
+ -@erase "$(OUTDIR)\Network_Events.pdb"
+
+"$(OUTDIR)" :
+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
"$(INTDIR)" :
if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)"
@@ -195,49 +204,52 @@ CPP_SBRS=.\.
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
-BSC32_FLAGS=/nologo /o"$(OUTDIR)/test_timeout.bsc"
+BSC32_FLAGS=/nologo /o"$(OUTDIR)/Network_Events.bsc"
BSC32_SBRS= \
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 /subsystem:console /debug /machine:I386
-# ADD LINK32 ace.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
-LINK32_FLAGS=ace.lib kernel32.lib user32.lib gdi32.lib winspool.lib\
+# ADD LINK32 aced.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
+LINK32_FLAGS=aced.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 /incremental:yes\
- /pdb:"$(OUTDIR)/test_timeout.pdb" /debug /machine:I386\
- /out:"$(OUTDIR)/test_timeout.exe"
+ /pdb:"$(OUTDIR)/Network_Events.pdb" /debug /machine:I386\
+ /out:"$(OUTDIR)/Network_Events.exe"
LINK32_OBJS= \
- "$(INTDIR)\test_timeout.obj"
+ "$(INTDIR)\test_network_events.obj"
-"$(OUTDIR)\test_timeout.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
+"$(OUTDIR)\Network_Events.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
$(LINK32) @<<
$(LINK32_FLAGS) $(LINK32_OBJS)
<<
-!ELSEIF "$(CFG)" == "test_MT - Win32 Debug"
+!ELSEIF "$(CFG)" == "Registration - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "test_MT\Debug"
-# PROP BASE Intermediate_Dir "test_MT\Debug"
-# PROP BASE Target_Dir "test_MT"
+# PROP BASE Output_Dir "Registration\Debug"
+# PROP BASE Intermediate_Dir "Registration\Debug"
+# PROP BASE Target_Dir "Registration"
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
-# PROP Output_Dir ""
+# PROP Output_Dir "."
# PROP Intermediate_Dir "Debug"
-# PROP Target_Dir "test_MT"
-OUTDIR=.
+# PROP Target_Dir "Registration"
+OUTDIR=.\.
INTDIR=.\Debug
-ALL : "$(OUTDIR)\test_MT.exe"
+ALL : "$(OUTDIR)\Registration.exe"
CLEAN :
- -@erase "$(INTDIR)\test_MT.obj"
+ -@erase "$(INTDIR)\test_registration.obj"
-@erase "$(INTDIR)\vc40.idb"
-@erase "$(INTDIR)\vc40.pdb"
- -@erase "$(OUTDIR)\test_MT.exe"
- -@erase "$(OUTDIR)\test_MT.ilk"
- -@erase "$(OUTDIR)\test_MT.pdb"
+ -@erase "$(OUTDIR)\Registration.exe"
+ -@erase "$(OUTDIR)\Registration.ilk"
+ -@erase "$(OUTDIR)\Registration.pdb"
+
+"$(OUTDIR)" :
+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
"$(INTDIR)" :
if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)"
@@ -251,48 +263,49 @@ CPP_SBRS=.\.
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
-BSC32_FLAGS=/nologo /o"$(OUTDIR)/test_MT.bsc"
+BSC32_FLAGS=/nologo /o"$(OUTDIR)/Registration.bsc"
BSC32_SBRS= \
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 /subsystem:console /debug /machine:I386
-# ADD LINK32 ace.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
-LINK32_FLAGS=ace.lib kernel32.lib user32.lib gdi32.lib winspool.lib\
+# ADD LINK32 aced.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
+LINK32_FLAGS=aced.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 /incremental:yes\
- /pdb:"$(OUTDIR)/test_MT.pdb" /debug /machine:I386 /out:"$(OUTDIR)/test_MT.exe"
+ /pdb:"$(OUTDIR)/Registration.pdb" /debug /machine:I386\
+ /out:"$(OUTDIR)/Registration.exe"
LINK32_OBJS= \
- "$(INTDIR)\test_MT.obj"
+ "$(INTDIR)\test_registration.obj"
-"$(OUTDIR)\test_MT.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
+"$(OUTDIR)\Registration.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
$(LINK32) @<<
$(LINK32_FLAGS) $(LINK32_OBJS)
<<
-!ELSEIF "$(CFG)" == "test_exception - Win32 Debug"
+!ELSEIF "$(CFG)" == "Removals - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "test_exception\Debug"
-# PROP BASE Intermediate_Dir "test_exception\Debug"
-# PROP BASE Target_Dir "test_exception"
+# PROP BASE Output_Dir "Removals\Debug"
+# PROP BASE Intermediate_Dir "Removals\Debug"
+# PROP BASE Target_Dir "Removals"
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "."
# PROP Intermediate_Dir "Debug"
-# PROP Target_Dir "test_exception"
+# PROP Target_Dir "Removals"
OUTDIR=.\.
INTDIR=.\Debug
-ALL : "$(OUTDIR)\test_exception.exe"
+ALL : "$(OUTDIR)\Removals.exe"
CLEAN :
- -@erase "$(INTDIR)\test_exceptions.obj"
+ -@erase "$(INTDIR)\test_removals.obj"
-@erase "$(INTDIR)\vc40.idb"
-@erase "$(INTDIR)\vc40.pdb"
- -@erase "$(OUTDIR)\test_exception.exe"
- -@erase "$(OUTDIR)\test_exception.ilk"
- -@erase "$(OUTDIR)\test_exception.pdb"
+ -@erase "$(OUTDIR)\Removals.exe"
+ -@erase "$(OUTDIR)\Removals.ilk"
+ -@erase "$(OUTDIR)\Removals.pdb"
"$(OUTDIR)" :
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
@@ -309,49 +322,49 @@ CPP_SBRS=.\.
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
-BSC32_FLAGS=/nologo /o"$(OUTDIR)/test_exception.bsc"
+BSC32_FLAGS=/nologo /o"$(OUTDIR)/Removals.bsc"
BSC32_SBRS= \
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 /subsystem:console /debug /machine:I386
-# ADD LINK32 ace.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
-LINK32_FLAGS=ace.lib kernel32.lib user32.lib gdi32.lib winspool.lib\
+# ADD LINK32 aced.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
+LINK32_FLAGS=aced.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 /incremental:yes\
- /pdb:"$(OUTDIR)/test_exception.pdb" /debug /machine:I386\
- /out:"$(OUTDIR)/test_exception.exe"
+ /pdb:"$(OUTDIR)/Removals.pdb" /debug /machine:I386\
+ /out:"$(OUTDIR)/Removals.exe"
LINK32_OBJS= \
- "$(INTDIR)\test_exceptions.obj"
+ "$(INTDIR)\test_removals.obj"
-"$(OUTDIR)\test_exception.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
+"$(OUTDIR)\Removals.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
$(LINK32) @<<
$(LINK32_FLAGS) $(LINK32_OBJS)
<<
-!ELSEIF "$(CFG)" == "simple - Win32 Debug"
+!ELSEIF "$(CFG)" == "Talker - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "simple\Debug"
-# PROP BASE Intermediate_Dir "simple\Debug"
-# PROP BASE Target_Dir "simple"
+# PROP BASE Output_Dir "Talker\Debug"
+# PROP BASE Intermediate_Dir "Talker\Debug"
+# PROP BASE Target_Dir "Talker"
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "."
# PROP Intermediate_Dir "Debug"
-# PROP Target_Dir "simple"
+# PROP Target_Dir "Talker"
OUTDIR=.\.
INTDIR=.\Debug
-ALL : "$(OUTDIR)\simple.exe"
+ALL : "$(OUTDIR)\Talker.exe"
CLEAN :
- -@erase "$(INTDIR)\simple_test.obj"
+ -@erase "$(INTDIR)\test_talker.obj"
-@erase "$(INTDIR)\vc40.idb"
-@erase "$(INTDIR)\vc40.pdb"
- -@erase "$(OUTDIR)\simple.exe"
- -@erase "$(OUTDIR)\simple.ilk"
- -@erase "$(OUTDIR)\simple.pdb"
+ -@erase "$(OUTDIR)\Talker.exe"
+ -@erase "$(OUTDIR)\Talker.ilk"
+ -@erase "$(OUTDIR)\Talker.pdb"
"$(OUTDIR)" :
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
@@ -368,48 +381,48 @@ CPP_SBRS=.\.
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
-BSC32_FLAGS=/nologo /o"$(OUTDIR)/simple.bsc"
+BSC32_FLAGS=/nologo /o"$(OUTDIR)/Talker.bsc"
BSC32_SBRS= \
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 /subsystem:console /debug /machine:I386
-# ADD LINK32 ace.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
-LINK32_FLAGS=ace.lib kernel32.lib user32.lib gdi32.lib winspool.lib\
+# ADD LINK32 aced.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
+LINK32_FLAGS=aced.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 /incremental:yes\
- /pdb:"$(OUTDIR)/simple.pdb" /debug /machine:I386 /out:"$(OUTDIR)/simple.exe"
+ /pdb:"$(OUTDIR)/Talker.pdb" /debug /machine:I386 /out:"$(OUTDIR)/Talker.exe"
LINK32_OBJS= \
- "$(INTDIR)\simple_test.obj"
+ "$(INTDIR)\test_talker.obj"
-"$(OUTDIR)\simple.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
+"$(OUTDIR)\Talker.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
$(LINK32) @<<
$(LINK32_FLAGS) $(LINK32_OBJS)
<<
-!ELSEIF "$(CFG)" == "network - Win32 Debug"
+!ELSEIF "$(CFG)" == "Timeouts - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "network\Debug"
-# PROP BASE Intermediate_Dir "network\Debug"
-# PROP BASE Target_Dir "network"
+# PROP BASE Output_Dir "Timeouts\Debug"
+# PROP BASE Intermediate_Dir "Timeouts\Debug"
+# PROP BASE Target_Dir "Timeouts"
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "."
# PROP Intermediate_Dir "Debug"
-# PROP Target_Dir "network"
+# PROP Target_Dir "Timeouts"
OUTDIR=.\.
INTDIR=.\Debug
-ALL : "$(OUTDIR)\network.exe"
+ALL : "$(OUTDIR)\Timeouts.exe"
CLEAN :
- -@erase "$(INTDIR)\network_test.obj"
+ -@erase "$(INTDIR)\test_timeouts.obj"
-@erase "$(INTDIR)\vc40.idb"
-@erase "$(INTDIR)\vc40.pdb"
- -@erase "$(OUTDIR)\network.exe"
- -@erase "$(OUTDIR)\network.ilk"
- -@erase "$(OUTDIR)\network.pdb"
+ -@erase "$(OUTDIR)\Timeouts.exe"
+ -@erase "$(OUTDIR)\Timeouts.ilk"
+ -@erase "$(OUTDIR)\Timeouts.pdb"
"$(OUTDIR)" :
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
@@ -426,20 +439,21 @@ CPP_SBRS=.\.
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
-BSC32_FLAGS=/nologo /o"$(OUTDIR)/network.bsc"
+BSC32_FLAGS=/nologo /o"$(OUTDIR)/Timeouts.bsc"
BSC32_SBRS= \
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 /subsystem:console /debug /machine:I386
-# ADD LINK32 ace.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
-LINK32_FLAGS=ace.lib kernel32.lib user32.lib gdi32.lib winspool.lib\
+# ADD LINK32 aced.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
+LINK32_FLAGS=aced.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 /incremental:yes\
- /pdb:"$(OUTDIR)/network.pdb" /debug /machine:I386 /out:"$(OUTDIR)/network.exe"
+ /pdb:"$(OUTDIR)/Timeouts.pdb" /debug /machine:I386\
+ /out:"$(OUTDIR)/Timeouts.exe"
LINK32_OBJS= \
- "$(INTDIR)\network_test.obj"
+ "$(INTDIR)\test_timeouts.obj"
-"$(OUTDIR)\network.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
+"$(OUTDIR)\Timeouts.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
$(LINK32) @<<
$(LINK32_FLAGS) $(LINK32_OBJS)
<<
@@ -447,7 +461,7 @@ LINK32_OBJS= \
!ENDIF
CPP_PROJ=/nologo /MDd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE"\
- /Fp"$(INTDIR)/ntalk.pch" /YX /Fo"$(INTDIR)/" /Fd"$(INTDIR)/" /c
+ /Fp"$(INTDIR)/Exceptions.pch" /YX /Fo"$(INTDIR)/" /Fd"$(INTDIR)/" /c
.c{$(CPP_OBJS)}.obj:
$(CPP) $(CPP_PROJ) $<
@@ -470,11 +484,11 @@ CPP_PROJ=/nologo /MDd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE"\
################################################################################
# Begin Target
-# Name "ntalk - Win32 Debug"
+# Name "Exceptions - Win32 Debug"
################################################################################
# Begin Source File
-SOURCE=.\test_reactorEx.cpp
+SOURCE=.\test_exceptions.cpp
DEP_CPP_TEST_=\
{$(INCLUDE)}"\ace\ACE.h"\
{$(INCLUDE)}"\ace\ACE.i"\
@@ -497,8 +511,6 @@ DEP_CPP_TEST_=\
{$(INCLUDE)}"\ace\Free_List.cpp"\
{$(INCLUDE)}"\ace\Free_List.h"\
{$(INCLUDE)}"\ace\Free_List.i"\
- {$(INCLUDE)}"\ace\Get_Opt.h"\
- {$(INCLUDE)}"\ace\Get_Opt.i"\
{$(INCLUDE)}"\ace\Handle_Set.h"\
{$(INCLUDE)}"\ace\Handle_Set.i"\
{$(INCLUDE)}"\ace\Hash_Map_Manager.cpp"\
@@ -533,9 +545,8 @@ DEP_CPP_TEST_=\
{$(INCLUDE)}"\ace\Message_Queue.cpp"\
{$(INCLUDE)}"\ace\Message_Queue.h"\
{$(INCLUDE)}"\ace\Message_Queue.i"\
- {$(INCLUDE)}"\ace\Module.cpp"\
- {$(INCLUDE)}"\ace\Module.h"\
- {$(INCLUDE)}"\ace\Module.i"\
+ {$(INCLUDE)}"\ace\Object_Manager.h"\
+ {$(INCLUDE)}"\ace\Object_Manager.i"\
{$(INCLUDE)}"\ace\OS.h"\
{$(INCLUDE)}"\ace\OS.i"\
{$(INCLUDE)}"\ace\Pipe.h"\
@@ -556,10 +567,6 @@ DEP_CPP_TEST_=\
{$(INCLUDE)}"\ace\Signal.i"\
{$(INCLUDE)}"\ace\SOCK.h"\
{$(INCLUDE)}"\ace\SOCK.i"\
- {$(INCLUDE)}"\ace\SOCK_Acceptor.h"\
- {$(INCLUDE)}"\ace\SOCK_Acceptor.i"\
- {$(INCLUDE)}"\ace\SOCK_Connector.h"\
- {$(INCLUDE)}"\ace\SOCK_Connector.i"\
{$(INCLUDE)}"\ace\SOCK_IO.h"\
{$(INCLUDE)}"\ace\SOCK_IO.i"\
{$(INCLUDE)}"\ace\SOCK_Stream.h"\
@@ -570,9 +577,6 @@ DEP_CPP_TEST_=\
{$(INCLUDE)}"\ace\Strategies.h"\
{$(INCLUDE)}"\ace\Strategies_T.cpp"\
{$(INCLUDE)}"\ace\Strategies_T.h"\
- {$(INCLUDE)}"\ace\Stream_Modules.cpp"\
- {$(INCLUDE)}"\ace\Stream_Modules.h"\
- {$(INCLUDE)}"\ace\Stream_Modules.i"\
{$(INCLUDE)}"\ace\SV_Semaphore_Complex.h"\
{$(INCLUDE)}"\ace\SV_Semaphore_Complex.i"\
{$(INCLUDE)}"\ace\SV_Semaphore_Simple.h"\
@@ -584,11 +588,6 @@ DEP_CPP_TEST_=\
{$(INCLUDE)}"\ace\Synch_T.cpp"\
{$(INCLUDE)}"\ace\Synch_T.h"\
{$(INCLUDE)}"\ace\Synch_T.i"\
- {$(INCLUDE)}"\ace\Task.h"\
- {$(INCLUDE)}"\ace\Task.i"\
- {$(INCLUDE)}"\ace\Task_T.cpp"\
- {$(INCLUDE)}"\ace\Task_T.h"\
- {$(INCLUDE)}"\ace\Task_T.i"\
{$(INCLUDE)}"\ace\Thread.h"\
{$(INCLUDE)}"\ace\Thread.i"\
{$(INCLUDE)}"\ace\Thread_Manager.h"\
@@ -613,7 +612,7 @@ DEP_CPP_TEST_=\
{$(INCLUDE)}"\ace\ws2tcpip.h"\
-"$(INTDIR)\test_reactorEx.obj" : $(SOURCE) $(DEP_CPP_TEST_) "$(INTDIR)"
+"$(INTDIR)\test_exceptions.obj" : $(SOURCE) $(DEP_CPP_TEST_) "$(INTDIR)"
# End Source File
@@ -621,12 +620,12 @@ DEP_CPP_TEST_=\
################################################################################
# Begin Target
-# Name "test_remove_handler - Win32 Debug"
+# Name "Multithreading - Win32 Debug"
################################################################################
# Begin Source File
-SOURCE=.\test_remove_handler.cpp
-DEP_CPP_TEST_R=\
+SOURCE=.\test_multithreading.cpp
+DEP_CPP_TEST_M=\
{$(INCLUDE)}"\ace\ACE.h"\
{$(INCLUDE)}"\ace\ACE.i"\
{$(INCLUDE)}"\ace\Addr.h"\
@@ -648,6 +647,8 @@ DEP_CPP_TEST_R=\
{$(INCLUDE)}"\ace\Free_List.cpp"\
{$(INCLUDE)}"\ace\Free_List.h"\
{$(INCLUDE)}"\ace\Free_List.i"\
+ {$(INCLUDE)}"\ace\Get_Opt.h"\
+ {$(INCLUDE)}"\ace\Get_Opt.i"\
{$(INCLUDE)}"\ace\Handle_Set.h"\
{$(INCLUDE)}"\ace\Handle_Set.i"\
{$(INCLUDE)}"\ace\Hash_Map_Manager.cpp"\
@@ -682,6 +683,11 @@ DEP_CPP_TEST_R=\
{$(INCLUDE)}"\ace\Message_Queue.cpp"\
{$(INCLUDE)}"\ace\Message_Queue.h"\
{$(INCLUDE)}"\ace\Message_Queue.i"\
+ {$(INCLUDE)}"\ace\Module.cpp"\
+ {$(INCLUDE)}"\ace\Module.h"\
+ {$(INCLUDE)}"\ace\Module.i"\
+ {$(INCLUDE)}"\ace\Object_Manager.h"\
+ {$(INCLUDE)}"\ace\Object_Manager.i"\
{$(INCLUDE)}"\ace\OS.h"\
{$(INCLUDE)}"\ace\OS.i"\
{$(INCLUDE)}"\ace\Pipe.h"\
@@ -712,6 +718,9 @@ DEP_CPP_TEST_R=\
{$(INCLUDE)}"\ace\Strategies.h"\
{$(INCLUDE)}"\ace\Strategies_T.cpp"\
{$(INCLUDE)}"\ace\Strategies_T.h"\
+ {$(INCLUDE)}"\ace\Stream_Modules.cpp"\
+ {$(INCLUDE)}"\ace\Stream_Modules.h"\
+ {$(INCLUDE)}"\ace\Stream_Modules.i"\
{$(INCLUDE)}"\ace\SV_Semaphore_Complex.h"\
{$(INCLUDE)}"\ace\SV_Semaphore_Complex.i"\
{$(INCLUDE)}"\ace\SV_Semaphore_Simple.h"\
@@ -723,6 +732,11 @@ DEP_CPP_TEST_R=\
{$(INCLUDE)}"\ace\Synch_T.cpp"\
{$(INCLUDE)}"\ace\Synch_T.h"\
{$(INCLUDE)}"\ace\Synch_T.i"\
+ {$(INCLUDE)}"\ace\Task.h"\
+ {$(INCLUDE)}"\ace\Task.i"\
+ {$(INCLUDE)}"\ace\Task_T.cpp"\
+ {$(INCLUDE)}"\ace\Task_T.h"\
+ {$(INCLUDE)}"\ace\Task_T.i"\
{$(INCLUDE)}"\ace\Thread.h"\
{$(INCLUDE)}"\ace\Thread.i"\
{$(INCLUDE)}"\ace\Thread_Manager.h"\
@@ -747,7 +761,7 @@ DEP_CPP_TEST_R=\
{$(INCLUDE)}"\ace\ws2tcpip.h"\
-"$(INTDIR)\test_remove_handler.obj" : $(SOURCE) $(DEP_CPP_TEST_R) "$(INTDIR)"
+"$(INTDIR)\test_multithreading.obj" : $(SOURCE) $(DEP_CPP_TEST_M) "$(INTDIR)"
# End Source File
@@ -755,12 +769,12 @@ DEP_CPP_TEST_R=\
################################################################################
# Begin Target
-# Name "test_timeout - Win32 Debug"
+# Name "Network_Events - Win32 Debug"
################################################################################
# Begin Source File
-SOURCE=.\test_timeout.cpp
-DEP_CPP_TEST_T=\
+SOURCE=.\test_network_events.cpp
+DEP_CPP_TEST_N=\
{$(INCLUDE)}"\ace\ACE.h"\
{$(INCLUDE)}"\ace\ACE.i"\
{$(INCLUDE)}"\ace\Addr.h"\
@@ -816,6 +830,8 @@ DEP_CPP_TEST_T=\
{$(INCLUDE)}"\ace\Message_Queue.cpp"\
{$(INCLUDE)}"\ace\Message_Queue.h"\
{$(INCLUDE)}"\ace\Message_Queue.i"\
+ {$(INCLUDE)}"\ace\Object_Manager.h"\
+ {$(INCLUDE)}"\ace\Object_Manager.i"\
{$(INCLUDE)}"\ace\OS.h"\
{$(INCLUDE)}"\ace\OS.i"\
{$(INCLUDE)}"\ace\Pipe.h"\
@@ -836,6 +852,8 @@ DEP_CPP_TEST_T=\
{$(INCLUDE)}"\ace\Signal.i"\
{$(INCLUDE)}"\ace\SOCK.h"\
{$(INCLUDE)}"\ace\SOCK.i"\
+ {$(INCLUDE)}"\ace\SOCK_Acceptor.h"\
+ {$(INCLUDE)}"\ace\SOCK_Acceptor.i"\
{$(INCLUDE)}"\ace\SOCK_IO.h"\
{$(INCLUDE)}"\ace\SOCK_IO.i"\
{$(INCLUDE)}"\ace\SOCK_Stream.h"\
@@ -881,7 +899,7 @@ DEP_CPP_TEST_T=\
{$(INCLUDE)}"\ace\ws2tcpip.h"\
-"$(INTDIR)\test_timeout.obj" : $(SOURCE) $(DEP_CPP_TEST_T) "$(INTDIR)"
+"$(INTDIR)\test_network_events.obj" : $(SOURCE) $(DEP_CPP_TEST_N) "$(INTDIR)"
# End Source File
@@ -889,12 +907,12 @@ DEP_CPP_TEST_T=\
################################################################################
# Begin Target
-# Name "test_MT - Win32 Debug"
+# Name "Registration - Win32 Debug"
################################################################################
# Begin Source File
-SOURCE=.\test_MT.cpp
-DEP_CPP_TEST_M=\
+SOURCE=.\test_registration.cpp
+DEP_CPP_TEST_R=\
{$(INCLUDE)}"\ace\ACE.h"\
{$(INCLUDE)}"\ace\ACE.i"\
{$(INCLUDE)}"\ace\Addr.h"\
@@ -916,8 +934,6 @@ DEP_CPP_TEST_M=\
{$(INCLUDE)}"\ace\Free_List.cpp"\
{$(INCLUDE)}"\ace\Free_List.h"\
{$(INCLUDE)}"\ace\Free_List.i"\
- {$(INCLUDE)}"\ace\Get_Opt.h"\
- {$(INCLUDE)}"\ace\Get_Opt.i"\
{$(INCLUDE)}"\ace\Handle_Set.h"\
{$(INCLUDE)}"\ace\Handle_Set.i"\
{$(INCLUDE)}"\ace\Hash_Map_Manager.cpp"\
@@ -952,9 +968,8 @@ DEP_CPP_TEST_M=\
{$(INCLUDE)}"\ace\Message_Queue.cpp"\
{$(INCLUDE)}"\ace\Message_Queue.h"\
{$(INCLUDE)}"\ace\Message_Queue.i"\
- {$(INCLUDE)}"\ace\Module.cpp"\
- {$(INCLUDE)}"\ace\Module.h"\
- {$(INCLUDE)}"\ace\Module.i"\
+ {$(INCLUDE)}"\ace\Object_Manager.h"\
+ {$(INCLUDE)}"\ace\Object_Manager.i"\
{$(INCLUDE)}"\ace\OS.h"\
{$(INCLUDE)}"\ace\OS.i"\
{$(INCLUDE)}"\ace\Pipe.h"\
@@ -985,9 +1000,6 @@ DEP_CPP_TEST_M=\
{$(INCLUDE)}"\ace\Strategies.h"\
{$(INCLUDE)}"\ace\Strategies_T.cpp"\
{$(INCLUDE)}"\ace\Strategies_T.h"\
- {$(INCLUDE)}"\ace\Stream_Modules.cpp"\
- {$(INCLUDE)}"\ace\Stream_Modules.h"\
- {$(INCLUDE)}"\ace\Stream_Modules.i"\
{$(INCLUDE)}"\ace\SV_Semaphore_Complex.h"\
{$(INCLUDE)}"\ace\SV_Semaphore_Complex.i"\
{$(INCLUDE)}"\ace\SV_Semaphore_Simple.h"\
@@ -999,11 +1011,6 @@ DEP_CPP_TEST_M=\
{$(INCLUDE)}"\ace\Synch_T.cpp"\
{$(INCLUDE)}"\ace\Synch_T.h"\
{$(INCLUDE)}"\ace\Synch_T.i"\
- {$(INCLUDE)}"\ace\Task.h"\
- {$(INCLUDE)}"\ace\Task.i"\
- {$(INCLUDE)}"\ace\Task_T.cpp"\
- {$(INCLUDE)}"\ace\Task_T.h"\
- {$(INCLUDE)}"\ace\Task_T.i"\
{$(INCLUDE)}"\ace\Thread.h"\
{$(INCLUDE)}"\ace\Thread.i"\
{$(INCLUDE)}"\ace\Thread_Manager.h"\
@@ -1028,7 +1035,7 @@ DEP_CPP_TEST_M=\
{$(INCLUDE)}"\ace\ws2tcpip.h"\
-"$(INTDIR)\test_MT.obj" : $(SOURCE) $(DEP_CPP_TEST_M) "$(INTDIR)"
+"$(INTDIR)\test_registration.obj" : $(SOURCE) $(DEP_CPP_TEST_R) "$(INTDIR)"
# End Source File
@@ -1036,12 +1043,12 @@ DEP_CPP_TEST_M=\
################################################################################
# Begin Target
-# Name "test_exception - Win32 Debug"
+# Name "Removals - Win32 Debug"
################################################################################
# Begin Source File
-SOURCE=.\test_exceptions.cpp
-DEP_CPP_TEST_E=\
+SOURCE=.\test_removals.cpp
+DEP_CPP_TEST_RE=\
{$(INCLUDE)}"\ace\ACE.h"\
{$(INCLUDE)}"\ace\ACE.i"\
{$(INCLUDE)}"\ace\Addr.h"\
@@ -1097,6 +1104,8 @@ DEP_CPP_TEST_E=\
{$(INCLUDE)}"\ace\Message_Queue.cpp"\
{$(INCLUDE)}"\ace\Message_Queue.h"\
{$(INCLUDE)}"\ace\Message_Queue.i"\
+ {$(INCLUDE)}"\ace\Object_Manager.h"\
+ {$(INCLUDE)}"\ace\Object_Manager.i"\
{$(INCLUDE)}"\ace\OS.h"\
{$(INCLUDE)}"\ace\OS.i"\
{$(INCLUDE)}"\ace\Pipe.h"\
@@ -1162,7 +1171,7 @@ DEP_CPP_TEST_E=\
{$(INCLUDE)}"\ace\ws2tcpip.h"\
-"$(INTDIR)\test_exceptions.obj" : $(SOURCE) $(DEP_CPP_TEST_E) "$(INTDIR)"
+"$(INTDIR)\test_removals.obj" : $(SOURCE) $(DEP_CPP_TEST_RE) "$(INTDIR)"
# End Source File
@@ -1170,12 +1179,12 @@ DEP_CPP_TEST_E=\
################################################################################
# Begin Target
-# Name "simple - Win32 Debug"
+# Name "Talker - Win32 Debug"
################################################################################
# Begin Source File
-SOURCE=.\simple_test.cpp
-DEP_CPP_SIMPL=\
+SOURCE=.\test_talker.cpp
+DEP_CPP_TEST_T=\
{$(INCLUDE)}"\ace\ACE.h"\
{$(INCLUDE)}"\ace\ACE.i"\
{$(INCLUDE)}"\ace\Addr.h"\
@@ -1197,6 +1206,8 @@ DEP_CPP_SIMPL=\
{$(INCLUDE)}"\ace\Free_List.cpp"\
{$(INCLUDE)}"\ace\Free_List.h"\
{$(INCLUDE)}"\ace\Free_List.i"\
+ {$(INCLUDE)}"\ace\Get_Opt.h"\
+ {$(INCLUDE)}"\ace\Get_Opt.i"\
{$(INCLUDE)}"\ace\Handle_Set.h"\
{$(INCLUDE)}"\ace\Handle_Set.i"\
{$(INCLUDE)}"\ace\Hash_Map_Manager.cpp"\
@@ -1231,6 +1242,11 @@ DEP_CPP_SIMPL=\
{$(INCLUDE)}"\ace\Message_Queue.cpp"\
{$(INCLUDE)}"\ace\Message_Queue.h"\
{$(INCLUDE)}"\ace\Message_Queue.i"\
+ {$(INCLUDE)}"\ace\Module.cpp"\
+ {$(INCLUDE)}"\ace\Module.h"\
+ {$(INCLUDE)}"\ace\Module.i"\
+ {$(INCLUDE)}"\ace\Object_Manager.h"\
+ {$(INCLUDE)}"\ace\Object_Manager.i"\
{$(INCLUDE)}"\ace\OS.h"\
{$(INCLUDE)}"\ace\OS.i"\
{$(INCLUDE)}"\ace\Pipe.h"\
@@ -1251,6 +1267,10 @@ DEP_CPP_SIMPL=\
{$(INCLUDE)}"\ace\Signal.i"\
{$(INCLUDE)}"\ace\SOCK.h"\
{$(INCLUDE)}"\ace\SOCK.i"\
+ {$(INCLUDE)}"\ace\SOCK_Acceptor.h"\
+ {$(INCLUDE)}"\ace\SOCK_Acceptor.i"\
+ {$(INCLUDE)}"\ace\SOCK_Connector.h"\
+ {$(INCLUDE)}"\ace\SOCK_Connector.i"\
{$(INCLUDE)}"\ace\SOCK_IO.h"\
{$(INCLUDE)}"\ace\SOCK_IO.i"\
{$(INCLUDE)}"\ace\SOCK_Stream.h"\
@@ -1261,6 +1281,9 @@ DEP_CPP_SIMPL=\
{$(INCLUDE)}"\ace\Strategies.h"\
{$(INCLUDE)}"\ace\Strategies_T.cpp"\
{$(INCLUDE)}"\ace\Strategies_T.h"\
+ {$(INCLUDE)}"\ace\Stream_Modules.cpp"\
+ {$(INCLUDE)}"\ace\Stream_Modules.h"\
+ {$(INCLUDE)}"\ace\Stream_Modules.i"\
{$(INCLUDE)}"\ace\SV_Semaphore_Complex.h"\
{$(INCLUDE)}"\ace\SV_Semaphore_Complex.i"\
{$(INCLUDE)}"\ace\SV_Semaphore_Simple.h"\
@@ -1272,6 +1295,11 @@ DEP_CPP_SIMPL=\
{$(INCLUDE)}"\ace\Synch_T.cpp"\
{$(INCLUDE)}"\ace\Synch_T.h"\
{$(INCLUDE)}"\ace\Synch_T.i"\
+ {$(INCLUDE)}"\ace\Task.h"\
+ {$(INCLUDE)}"\ace\Task.i"\
+ {$(INCLUDE)}"\ace\Task_T.cpp"\
+ {$(INCLUDE)}"\ace\Task_T.h"\
+ {$(INCLUDE)}"\ace\Task_T.i"\
{$(INCLUDE)}"\ace\Thread.h"\
{$(INCLUDE)}"\ace\Thread.i"\
{$(INCLUDE)}"\ace\Thread_Manager.h"\
@@ -1296,7 +1324,7 @@ DEP_CPP_SIMPL=\
{$(INCLUDE)}"\ace\ws2tcpip.h"\
-"$(INTDIR)\simple_test.obj" : $(SOURCE) $(DEP_CPP_SIMPL) "$(INTDIR)"
+"$(INTDIR)\test_talker.obj" : $(SOURCE) $(DEP_CPP_TEST_T) "$(INTDIR)"
# End Source File
@@ -1304,12 +1332,12 @@ DEP_CPP_SIMPL=\
################################################################################
# Begin Target
-# Name "network - Win32 Debug"
+# Name "Timeouts - Win32 Debug"
################################################################################
# Begin Source File
-SOURCE=.\network_test.cpp
-DEP_CPP_NETWO=\
+SOURCE=.\test_timeouts.cpp
+DEP_CPP_TEST_TI=\
{$(INCLUDE)}"\ace\ACE.h"\
{$(INCLUDE)}"\ace\ACE.i"\
{$(INCLUDE)}"\ace\Addr.h"\
@@ -1365,6 +1393,8 @@ DEP_CPP_NETWO=\
{$(INCLUDE)}"\ace\Message_Queue.cpp"\
{$(INCLUDE)}"\ace\Message_Queue.h"\
{$(INCLUDE)}"\ace\Message_Queue.i"\
+ {$(INCLUDE)}"\ace\Object_Manager.h"\
+ {$(INCLUDE)}"\ace\Object_Manager.i"\
{$(INCLUDE)}"\ace\OS.h"\
{$(INCLUDE)}"\ace\OS.i"\
{$(INCLUDE)}"\ace\Pipe.h"\
@@ -1385,8 +1415,6 @@ DEP_CPP_NETWO=\
{$(INCLUDE)}"\ace\Signal.i"\
{$(INCLUDE)}"\ace\SOCK.h"\
{$(INCLUDE)}"\ace\SOCK.i"\
- {$(INCLUDE)}"\ace\SOCK_Acceptor.h"\
- {$(INCLUDE)}"\ace\SOCK_Acceptor.i"\
{$(INCLUDE)}"\ace\SOCK_IO.h"\
{$(INCLUDE)}"\ace\SOCK_IO.i"\
{$(INCLUDE)}"\ace\SOCK_Stream.h"\
@@ -1432,7 +1460,7 @@ DEP_CPP_NETWO=\
{$(INCLUDE)}"\ace\ws2tcpip.h"\
-"$(INTDIR)\network_test.obj" : $(SOURCE) $(DEP_CPP_NETWO) "$(INTDIR)"
+"$(INTDIR)\test_timeouts.obj" : $(SOURCE) $(DEP_CPP_TEST_TI) "$(INTDIR)"
# End Source File
diff --git a/examples/Reactor/WFMO_Reactor/reactorex.mdp b/examples/Reactor/WFMO_Reactor/reactorex.mdp
index 8abb3eb3924..402dd6a5352 100644
--- a/examples/Reactor/WFMO_Reactor/reactorex.mdp
+++ b/examples/Reactor/WFMO_Reactor/reactorex.mdp
Binary files differ
diff --git a/examples/Reactor/WFMO_Reactor/test_exceptions.cpp b/examples/Reactor/WFMO_Reactor/test_exceptions.cpp
index f399d34a393..7a975ec1d12 100644
--- a/examples/Reactor/WFMO_Reactor/test_exceptions.cpp
+++ b/examples/Reactor/WFMO_Reactor/test_exceptions.cpp
@@ -1,3 +1,28 @@
+// $Id$
+//
+// ============================================================================
+//
+// = LIBRARY
+// examples
+//
+// = FILENAME
+// test_exceptions.cpp
+//
+// = DESCRIPTION
+//
+// This test application tests the state of ReactorEx when
+// exceptions occurs when executing user callbacks.
+//
+// The thread count in ReactorEx is used to ensure that state of
+// ReactorEx is not fouled up when exceptions occur in user code.
+// This example also shows how to write event loops that survive
+// user exceptions
+//
+// = AUTHOR
+// Irfan Pyarali
+//
+// ============================================================================
+
#include "ace/ReactorEx.h"
class Event_Handler : public ACE_Event_Handler
@@ -52,11 +77,9 @@ public:
int
main (int, char *[])
{
- Event_Handler *handler;
- ACE_NEW_RETURN (handler, Event_Handler, -1);
- ACE_ReactorEx::instance ()->register_handler (handler);
+ Event_Handler handler;
+ ACE_ReactorEx::instance ()->register_handler (&handler);
ACE_ReactorEx_Test::doit ();
- delete handler;
return 0;
}
diff --git a/examples/Reactor/ReactorEx/test_MT.cpp b/examples/Reactor/WFMO_Reactor/test_multithreading.cpp
index 5d346880938..01fccc19350 100644
--- a/examples/Reactor/ReactorEx/test_MT.cpp
+++ b/examples/Reactor/WFMO_Reactor/test_multithreading.cpp
@@ -1,10 +1,12 @@
+// $Id$
+//
// ============================================================================
//
// = LIBRARY
// examples
//
// = FILENAME
-// test_MT.cpp
+// test_multithreading.cpp
//
// = DESCRIPTION
// This application tests multiple threads simultaneously calling
@@ -121,7 +123,7 @@ Task_Handler::Task_Handler (size_t number_of_handles,
for (size_t i = 0; i < number_of_handles; i++)
{
if (ACE_ReactorEx::instance ()->register_handler (this,
- this->events_[i].handle ()) == -1)
+ this->events_[i].handle ()) == -1)
ACE_ERROR ((LM_ERROR, "%p\t cannot register handle %d with ReactorEx\n",
"Task_Handler::Task_Handler", i));
}
@@ -147,14 +149,14 @@ Task_Handler::handle_signal (int signum, siginfo_t *siginfo, ucontext_t *)
siginfo->si_handle_));
if (ACE_ReactorEx::instance ()->remove_handler (siginfo->si_handle_,
- ACE_Event_Handler::DONT_CALL) == -1)
+ ACE_Event_Handler::DONT_CALL) == -1)
ACE_ERROR_RETURN ((LM_ERROR,
"(%t) %p\tTask cannot be unregistered from ReactorEx: handle value = %d\n",
"Task_Handler::handle_signal",
siginfo->si_handle_), -1);
if (ACE_ReactorEx::instance ()->register_handler (this,
- siginfo->si_handle_) == -1)
+ siginfo->si_handle_) == -1)
ACE_ERROR_RETURN ((LM_ERROR,
"(%t) %p\tTask cannot be registered with ReactorEx: handle value = %d\n",
"Task_Handler::handle_signal",
@@ -209,8 +211,8 @@ main (int argc, char **argv)
// Setup a timer for the task
if (ACE_ReactorEx::instance ()->schedule_timer (&task,
- (void *) i,
- 0) == -1)
+ (void *) i,
+ 0) == -1)
ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "schedule_timer"), -1);
for (int i = 0; i < number_of_handles_to_signal; i++)
diff --git a/examples/Reactor/WFMO_Reactor/test_network_events.cpp b/examples/Reactor/WFMO_Reactor/test_network_events.cpp
new file mode 100644
index 00000000000..bfe63baed1b
--- /dev/null
+++ b/examples/Reactor/WFMO_Reactor/test_network_events.cpp
@@ -0,0 +1,183 @@
+// $Id$
+//
+// ============================================================================
+//
+// = LIBRARY
+// examples
+//
+// = FILENAME
+// test_network_events.cpp
+//
+// = DESCRIPTION
+//
+// This application tests ReactorEx to make sure that it responds
+// correctly to different kinds of network events.
+//
+// The test starts off by creating a Network_Listener, that listens
+// for connections at ACE_DEFAULT_SERVER_PORT. When a client
+// connects, a Network_Handler is created. Network_Handler reads
+// messages off the socket and prints them out. This is done until
+// the remote side shuts down. Multiple clients can connect at the
+// same time.
+//
+// Events tested in this example includes ACCEPT, READ, and CLOSE masks.
+//
+// To run this example, start an instance of this example and
+// connect to it using telnet (to port
+// ACE_DEFAULT_SERVER_PORT(10002)).
+//
+// = AUTHOR
+// Irfan Pyarali
+//
+// ============================================================================
+
+#include "ace/ReactorEx.h"
+#include "ace/INET_Addr.h"
+#include "ace/SOCK_Stream.h"
+#include "ace/SOCK_Acceptor.h"
+
+// Globals for this test
+int stop_test = 0;
+ACE_ReactorEx reactorEx;
+
+class Network_Handler : public ACE_Event_Handler
+{
+public:
+ Network_Handler (ACE_SOCK_Stream &s);
+ // Default constructor
+
+ virtual int handle_input (ACE_HANDLE handle);
+ virtual int handle_close (ACE_HANDLE handle,
+ ACE_Reactor_Mask close_mask);
+ virtual ACE_HANDLE get_handle (void) const;
+
+ ACE_SOCK_Stream stream_;
+
+};
+
+Network_Handler::Network_Handler (ACE_SOCK_Stream &s)
+ : stream_ (s)
+{
+ this->reactorEx (&::reactorEx);
+
+ ACE_Reactor_Mask mask = ACE_Event_Handler::READ_MASK | ACE_Event_Handler::CLOSE_MASK;
+ ACE_ASSERT (this->reactorEx ()->register_handler (this,
+ mask) == 0);
+}
+
+ACE_HANDLE
+Network_Handler::get_handle (void) const
+{
+ return this->stream_.get_handle ();
+}
+
+int
+Network_Handler::handle_input (ACE_HANDLE handle)
+{
+ ACE_DEBUG ((LM_DEBUG, "Network_Handler::handle_input handle = %d\n", handle));
+
+ char message[BUFSIZ];
+ int result = this->stream_.recv (message, sizeof message);
+ if (result > 0)
+ {
+ message[result] = 0;
+ ACE_DEBUG ((LM_DEBUG, "Remote message: %s\n", message));
+ return 0;
+ }
+ else
+ {
+ ACE_DEBUG ((LM_DEBUG, "Problems in receiving data, result = %d", result));
+ return -1;
+ }
+}
+
+int
+Network_Handler::handle_close (ACE_HANDLE handle,
+ ACE_Reactor_Mask close_mask)
+{
+ ACE_DEBUG ((LM_DEBUG, "Network_Handler::handle_close handle = %d\n", handle));
+
+ // Called because of remote shutdown
+ if (close_mask == ACE_Event_Handler::CLOSE_MASK)
+ {
+ ACE_Reactor_Mask mask = ACE_Event_Handler::DONT_CALL | ACE_Event_Handler::ALL_EVENTS_MASK;
+ this->reactorEx ()->remove_handler (this, mask);
+ }
+
+ this->stream_.close ();
+
+ delete this;
+
+ return 0;
+}
+
+class Network_Listener : public ACE_Event_Handler
+{
+public:
+ Network_Listener (void);
+ // Default constructor
+
+ virtual int handle_input (ACE_HANDLE handle);
+ virtual int handle_close (ACE_HANDLE handle,
+ ACE_Reactor_Mask close_mask);
+ ACE_HANDLE get_handle (void) const;
+
+ ACE_INET_Addr local_address_;
+ ACE_SOCK_Acceptor acceptor_;
+};
+
+Network_Listener::Network_Listener (void)
+ : local_address_ (ACE_DEFAULT_SERVER_PORT),
+ acceptor_ (local_address_, 1)
+{
+ this->reactorEx (&::reactorEx);
+ ACE_ASSERT (this->reactorEx ()->register_handler (this,
+ ACE_Event_Handler::ACCEPT_MASK) == 0);
+}
+
+ACE_HANDLE
+Network_Listener::get_handle (void) const
+{
+ return this->acceptor_.get_handle ();
+}
+
+int
+Network_Listener::handle_input (ACE_HANDLE handle)
+{
+ ACE_DEBUG ((LM_DEBUG, "Network_Listener::handle_input handle = %d\n", handle));
+
+ ACE_INET_Addr remote_address;
+ ACE_SOCK_Stream stream;
+
+ ACE_ASSERT (this->acceptor_.accept (stream, &remote_address) == 0);
+
+ ACE_DEBUG ((LM_DEBUG, "Remote connection from: "));
+ remote_address.dump ();
+
+ Network_Handler *handler = new Network_Handler (stream);
+
+ return 0;
+}
+
+int
+Network_Listener::handle_close (ACE_HANDLE handle,
+ ACE_Reactor_Mask close_mask)
+{
+ ACE_DEBUG ((LM_DEBUG, "Network_Listener::handle_close handle = %d\n", handle));
+
+ this->acceptor_.close ();
+ return 0;
+}
+
+int
+main ()
+{
+ Network_Listener listener;
+
+ int result = 0;
+ while (!stop_test && result != -1)
+ {
+ result = reactorEx.handle_events ();
+ }
+ return 0;
+};
diff --git a/examples/Reactor/WFMO_Reactor/test_registration.cpp b/examples/Reactor/WFMO_Reactor/test_registration.cpp
new file mode 100644
index 00000000000..5184424771e
--- /dev/null
+++ b/examples/Reactor/WFMO_Reactor/test_registration.cpp
@@ -0,0 +1,154 @@
+// $Id$
+//
+// ============================================================================
+//
+// = LIBRARY
+// examples
+//
+// = FILENAME
+// test_registration.cpp
+//
+// = DESCRIPTION
+//
+// This test application tests a wide range of registration,
+// suspension, resumption, and removal of events from ReactorEx.
+//
+// The application initially registers two events with ReactorEx. A
+// auxiliary thread is created to do the signaling on the
+// events. When the first event is signaled, the event is suspended
+// from ReactorEx. The event is then signaled again, but is "lost"
+// since the handler has been suspended. When the second event is
+// signal, the first event is resumed and the second is
+// suspended. When the first event is signaled again, both events
+// are removed from ReactorEx.
+//
+// This test shows off the following features of ReactorEx:
+// - Registration
+// - Suspension
+// - Resumption
+// - Removal (while active and while suspended)
+//
+// = AUTHOR
+// Irfan Pyarali
+//
+// ============================================================================
+
+#include "ace/ReactorEx.h"
+
+// Globals for this test
+int stop_test = 0;
+ACE_ReactorEx reactorEx;
+
+
+class Simple_Handler : public ACE_Event_Handler
+{
+public:
+ Simple_Handler (void);
+ // Default constructor
+
+ virtual int handle_signal (int signum, siginfo_t * = 0, ucontext_t * = 0);
+ virtual int handle_close (ACE_HANDLE handle,
+ ACE_Reactor_Mask close_mask);
+
+ ACE_Auto_Event event1_;
+ ACE_Auto_Event event2_;
+ int handle_signal_count_;
+ int handle_close_count_;
+};
+
+Simple_Handler::Simple_Handler (void)
+ : handle_signal_count_ (0),
+ handle_close_count_ (0)
+{
+}
+
+int
+Simple_Handler::handle_signal (int signum, siginfo_t *s, ucontext_t *)
+{
+ ACE_HANDLE handle = s->si_handle_;
+ ACE_DEBUG ((LM_DEBUG, "Simple_Handler::handle_signal handle = %d\n", handle));
+ this->handle_signal_count_++;
+
+ if (this->handle_signal_count_ == 1)
+ {
+ ACE_DEBUG ((LM_DEBUG, "suspending handle = %d\n", event1_.handle ()));
+ this->reactorEx ()->suspend_handler (event1_.handle ());
+ }
+ else if (this->handle_signal_count_ == 2)
+ {
+ ACE_DEBUG ((LM_DEBUG, "resuming handle = %d\n", event1_.handle ()));
+ this->reactorEx ()->resume_handler (event1_.handle ());
+ ACE_DEBUG ((LM_DEBUG, "suspending handle = %d\n", event2_.handle ()));
+ this->reactorEx ()->suspend_handler (event2_.handle ());
+ }
+ else if (this->handle_signal_count_ == 3)
+ {
+ ACE_DEBUG ((LM_DEBUG, "removing handle = %d\n", event1_.handle ()));
+ this->reactorEx ()->remove_handler (event1_.handle ());
+ ACE_DEBUG ((LM_DEBUG, "removing handle = %d\n", event2_.handle ()));
+ this->reactorEx ()->remove_handler (event2_.handle ());
+ }
+ return 0;
+}
+
+int
+Simple_Handler::handle_close (ACE_HANDLE handle,
+ ACE_Reactor_Mask close_mask)
+{
+ ACE_DEBUG ((LM_DEBUG, "Simple_Handler::handle_close handle = %d\n", handle));
+ this->handle_close_count_++;
+
+ if (this->handle_close_count_ == 1)
+ stop_test = 0;
+ else if (this->handle_close_count_ == 2)
+ stop_test = 1;
+
+ return 0;
+}
+
+// Globals for this test
+Simple_Handler simple_handler;
+
+void
+worker (void)
+{
+ ACE_DEBUG ((LM_DEBUG, "(%t) Thread creation\n"));
+ ACE_DEBUG ((LM_DEBUG, "(%t) Thread sleeping\n"));
+ ACE_OS::sleep (1);
+ ACE_DEBUG ((LM_DEBUG, "(%t) Thread signaling %d\n", simple_handler.event1_.handle()));
+ simple_handler.event1_.signal ();
+ ACE_DEBUG ((LM_DEBUG, "(%t) Thread sleeping\n"));
+ ACE_OS::sleep (1);
+ ACE_DEBUG ((LM_DEBUG, "(%t) Thread signaling %d\n", simple_handler.event1_.handle()));
+ ACE_DEBUG ((LM_DEBUG, "Note: This signal should be \"lost\" because of the suspended handler\n"));
+ simple_handler.event1_.signal ();
+ ACE_DEBUG ((LM_DEBUG, "(%t) Thread sleeping\n"));
+ ACE_OS::sleep (1);
+ ACE_DEBUG ((LM_DEBUG, "(%t) Thread resetting %d\n", simple_handler.event1_.handle()));
+ simple_handler.event1_.reset ();
+ ACE_DEBUG ((LM_DEBUG, "(%t) Thread signaling %d\n", simple_handler.event2_.handle()));
+ simple_handler.event2_.signal ();
+ ACE_DEBUG ((LM_DEBUG, "(%t) Thread sleeping\n"));
+ ACE_OS::sleep (1);
+ ACE_DEBUG ((LM_DEBUG, "(%t) Thread signaling %d\n", simple_handler.event1_.handle()));
+ simple_handler.event1_.signal ();
+ ACE_DEBUG ((LM_DEBUG, "(%t) Thread death\n"));
+}
+
+int
+main ()
+{
+ ACE_ASSERT (reactorEx.register_handler (&simple_handler,
+ simple_handler.event1_.handle ()) == 0);
+ ACE_ASSERT (reactorEx.register_handler (&simple_handler,
+ simple_handler.event2_.handle ()) == 0);
+
+ ACE_OS::thr_create ((ACE_THR_FUNC) worker, 0, 0, 0);
+
+ int result = 0;
+ while (!stop_test && result != -1)
+ {
+ result = reactorEx.handle_events ();
+ }
+ return 0;
+};
diff --git a/examples/Reactor/ReactorEx/test_remove_handler.cpp b/examples/Reactor/WFMO_Reactor/test_removals.cpp
index 5a8aa0e6649..fda33df704a 100644
--- a/examples/Reactor/ReactorEx/test_remove_handler.cpp
+++ b/examples/Reactor/WFMO_Reactor/test_removals.cpp
@@ -1,20 +1,22 @@
-// ============================================================================
// $Id$
-
+//
+// ============================================================================
//
// = LIBRARY
// examples
//
// = FILENAME
-// test_remove_handler.cpp
+// test_removals.cpp
//
// = DESCRIPTION
+//
// Tests the ReactorEx's ability to handle simultaneous events. If
// you pass anything on the command-line, then each handler
// requests to be removed from the ReactorEx after each event.
//
// = AUTHOR
// Tim Harrison
+// Irfan Pyarali
//
// ============================================================================
@@ -35,10 +37,10 @@ public:
Event_Handler (int event_number,
int close_down)
: event_number_ (event_number),
- close_down_ (close_down)
+ close_down_ (close_down)
{
if (ACE_ReactorEx::instance ()->register_handler (this,
- this->event_.handle ()) == -1)
+ this->event_.handle ()) == -1)
ACE_ERROR ((LM_ERROR, "%p\tevent handler %d cannot be added to ReactorEx\n", "", event_number_));
this->event_.signal ();
}
diff --git a/examples/Reactor/ReactorEx/test_reactorEx.cpp b/examples/Reactor/WFMO_Reactor/test_talker.cpp
index 5075437be94..7b2d53ca9b5 100644
--- a/examples/Reactor/ReactorEx/test_reactorEx.cpp
+++ b/examples/Reactor/WFMO_Reactor/test_talker.cpp
@@ -1,27 +1,134 @@
// $Id$
-
+//
// ============================================================================
//
// = LIBRARY
// examples
//
// = FILENAME
-// test_reactorEx.cpp
+// test_talker.cpp
//
// = DESCRIPTION
-// This test application tests a wide range of events that can be
-// demultiplexed using various ACE utilities. Events used include ^C
-// events, reading from STDIN, vanilla Win32 events, thread exits,
-// ReactorEx notifications, proactive reads, and proactive writes.
//
+// This test application tests a wide range of events that can be
+// demultiplexed using various ACE utilities. Events used include
+// ^C events, reading from STDIN, vanilla Win32 events, thread
+// exits, ReactorEx notifications, proactive reads, and proactive
+// writes.
+//
// The proactive I/O events are demultiplexed by the ACE_Proactor.
// The thread exits, notications, and vanilla Win32 events are
// demultiplexed by the ACE_ReactorEx. To enable a single thread
// to run all these events, the Proactor is integrated with the
// ReactorEx.
+//
+// The test application prototypes a simple talk program. Two
+// instances of the application connect. Input from either console
+// is displayed on the others console also. Because of the evils
+// of Win32 STDIN, a separate thread is used to read from STDIN.
+// To test the Proactor and ReactorEx, I/O between the remote
+// processes is performed proactively and interactions between the
+// STDIN thread and the main thread are performed reactively.
+//
+// The following description of the test application is in two
+// parts. The participants section explains the main components
+// involved in the application. The collaboration section
+// describes how the partipants interact in response to the
+// multiple event types which occur.
+//
+// The ReactorEx test application has the following participants:
+//
+// . ReactorEx -- The ReactorEx demultiplexes Win32 "waitable"
+// events using WaitForMultipleObjects.
+//
+// . Proactor -- The proactor initiates and demultiplexes
+// overlapped I/O operations. The Proactor registers with the
+// ReactorEx so that a single-thread can demultiplex all
+// application events.
+//
+// . STDIN_Handler -- STDIN_Handler is an Active Object which reads
+// from STDIN and forwards the input to the Peer_Handler. This
+// runs in a separate thread to make the test more interesting.
+// However, STDIN is "waitable", so in general it can be waited on
+// by the ACE ReactorEx, thanks MicroSlush!
+//
+// . Peer_Handler -- The Peer_Handler connects to another instance
+// of test_reactorEx. It Proactively reads and writes data to the
+// peer. When the STDIN_Handler gives it messages, it fowards them
+// to the remote peer. When it receives messages from the remote
+// peer, it prints the output to the console.
+//
+// The collaborations of the participants are as follows:
+//
+// . Initialization
+//
+// Peer_Handler -- connects to the remote peer. It then begins
+// proactively reading from the remote connection. Note that it
+// will be notified by the Proactor when a read completes. It
+// also registers a notification strategy with message queue so
+// that it is notified when the STDIN_Handler posts a message
+// onto the queue.
+//
+// STDIN_Handler -- STDIN_Handler registers a signal handler for
+// SIGINT. This just captures the exception so that the kernel
+// doesn't kill our process; We want to exit gracefully. It also
+// creates an Exit_Hook object which registers the
+// STDIN_Handler's thread handle with the ReactorEx. The
+// Exit_Hook will get called back when the STDIN_Handler thread
+// exits. After registering these, it blocks reading from STDIN.
+//
+// Proactor -- is registered with the ReactorEx.
+//
+// The main thread of control waits in the ReactorEx.
+//
+// . STDIN events -- When the STDIN_Handler thread reads from
+// STDIN, it puts the message on Peer_Handler's message queue. It
+// then returns to reading from STDIN.
+//
+// . Message enqueue -- The ReactorEx thread wakes up and calls
+// Peer_Handler::handle_output. The Peer_Handler then tries to
+// dequeue a message from its message queue. If it can, the
+// message is Proactively sent to the remote peer. Note that the
+// Peer_Handler will be notified with this operation is complete.
+// The Peer_Handler then falls back into the ReactorEx event loop.
+//
+// . Send complete event -- When a proactive send is complete, the
+// Proactor is notified by the ReactorEx. The Proactor, in turn,
+// notifies the Peer_Handler. The Peer_Handler then checks for
+// more messages from the message queue. If there are any, it
+// tries to send them. If there are not, it returns to the
+// ReactorEx event loop.
+//
+// . Read complete event -- When a proactive read is complete (the
+// Peer_Handler initiated a proactive read when it connected to the
+// remote peer), the Proactor is notified by the ReactorEx. The
+// Proactor, in turn notifies the Peer_Handler. If the read was
+// successful the Peer_Handler just displays the received msg to
+// the console and reinvokes a proactive read from the network
+// connection. If the read failed (i.e. the remote peer exited),
+// the Peer_Handler sets a flag to end the event loop and returns.
+// This will cause the application to exit.
+//
+// . ^C events -- When the user types ^C at the console, the
+// STDIN_Handler's signal handler will be called. It does nothing,
+// but as a result of the signal, the STDIN_Handler thread will
+// exit.
+//
+// . STDIN_Handler thread exits -- The Exit_Hook will get called
+// back from the ReactorEx. Exit_Hook::handle_signal sets a flag
+// to end the event loop and returns. This will cause the
+// application to exit.
+//
+//
+// To run example, start an instance of the test with an optional
+// local port argument (as the acceptor). Start the other instance
+// with -h <hostname> and -p <server port>. Type in either the
+// client or server windows and your message should show up in the
+// other window. Control C to exit.
//
// = AUTHOR
-// Tim Harrison
+// Tim Harrison
+// Irfan Pyarali
//
// ============================================================================
@@ -37,9 +144,9 @@
typedef ACE_Task<ACE_MT_SYNCH> MT_TASK;
class Peer_Handler : public MT_TASK, public ACE_Handler
- // = TITLE
- // Connect to a server. Receive messages from STDIN_Handler
- // and forward them to the server using proactive I/O.
+// = TITLE
+// Connect to a server. Receive messages from STDIN_Handler
+// and forward them to the server using proactive I/O.
{
public:
// = Initialization methods.
@@ -101,9 +208,9 @@ private:
};
class STDIN_Handler : public ACE_Task<ACE_NULL_SYNCH>
- // = TITLE
- // Active Object. Reads from STDIN and passes message blocks to
- // the peer handler.
+// = TITLE
+// Active Object. Reads from STDIN and passes message blocks to
+// the peer handler.
{
public:
STDIN_Handler (MT_TASK &ph);
@@ -155,15 +262,15 @@ Peer_Handler::Peer_Handler (int argc, char *argv[])
while ((c = get_opt ()) != EOF)
{
- switch (c)
- {
- case 'h':
- host_ = get_opt.optarg;
- break;
- case 'p':
- port_ = ACE_OS::atoi (get_opt.optarg);
- break;
- }
+ switch (c)
+ {
+ case 'h':
+ host_ = get_opt.optarg;
+ break;
+ case 'p':
+ port_ = ACE_OS::atoi (get_opt.optarg);
+ break;
+ }
}
}
diff --git a/examples/Reactor/WFMO_Reactor/test_timeout.cpp b/examples/Reactor/WFMO_Reactor/test_timeouts.cpp
index c176c330856..ce5925ac679 100644
--- a/examples/Reactor/WFMO_Reactor/test_timeout.cpp
+++ b/examples/Reactor/WFMO_Reactor/test_timeouts.cpp
@@ -1,25 +1,30 @@
-// $Id: test_timeout.cpp
-
+// $Id$
+//
// ============================================================================
//
// = LIBRARY
// examples
//
// = FILENAME
-// test_timeout.cpp
+// test_timeouts.cpp
//
// = DESCRIPTION
-// This example application shows how to write ReactorEx and
-// Proactor event loops that handle events for some fixed amount of
-// time.
+//
+// This example application shows how to write ReactorEx event
+// loops that handle events for some fixed amount of time.
+//
+// Run this example (without arguments) to see the timers
+// expire. The order should be:
+//
+// foo, bar, foo, bar, foo, foo, bar, foo, bar, foo
//
// = AUTHOR
// Tim Harrison
+// Irfan Pyarali
//
// ============================================================================
#include "ace/ReactorEx.h"
-#include "ace/Proactor.h"
#include "ace/Service_Config.h"
#include "ace/OS.h"
@@ -51,19 +56,19 @@ main (int, char *[])
{
Timeout_Handler handler;
- // Register a 2 second timer.
- ACE_Time_Value foo_tv (2);
- ACE_ReactorEx::instance ()->schedule_timer (&handler,
- (void *) "Foo",
- ACE_Time_Value::zero,
- foo_tv);
// Register a 3 second timer.
ACE_Time_Value bar_tv (3);
ACE_ReactorEx::instance ()->schedule_timer (&handler,
- (void *) "Bar",
- ACE_Time_Value::zero,
- bar_tv);
+ (void *) "Bar",
+ bar_tv,
+ bar_tv);
+ // Register a 2 second timer.
+ ACE_Time_Value foo_tv (2);
+ ACE_ReactorEx::instance ()->schedule_timer (&handler,
+ (void *) "Foo",
+ foo_tv,
+ foo_tv);
// Handle events for 12 seconds.
ACE_Time_Value run_time (12);
if (ACE_ReactorEx::run_event_loop(run_time) == -1)