summaryrefslogtreecommitdiff
path: root/docs/tutorials/Chap_5/ex05.html
diff options
context:
space:
mode:
Diffstat (limited to 'docs/tutorials/Chap_5/ex05.html')
-rw-r--r--docs/tutorials/Chap_5/ex05.html87
1 files changed, 0 insertions, 87 deletions
diff --git a/docs/tutorials/Chap_5/ex05.html b/docs/tutorials/Chap_5/ex05.html
deleted file mode 100644
index 665730fcace..00000000000
--- a/docs/tutorials/Chap_5/ex05.html
+++ /dev/null
@@ -1,87 +0,0 @@
-<HTML>
-<HEAD>
- <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
- <META NAME="Author" CONTENT="Ambreen Ilyas">
- <META NAME="GENERATOR" CONTENT="Mozilla/4.05 [en] (X11; I; SunOS 5.5.1 sun4u) [Netscape]">
- <TITLE>Example 5</TITLE>
-</HEAD>
-<BODY>
-<FONT COLOR="#CC0000">/////////////////////////////////////////////////////////////////////////////////////////////////////////////////</FONT>
-<BR><FONT COLOR="#CC0000">//// This example is from the ACE Programmers
-Guide.</FONT>
-<BR><FONT COLOR="#CC0000">////&nbsp; Chapter:&nbsp; "The Reactor" (Event
-Management)</FONT>
-<BR><FONT COLOR="#CC0000">//// For details please see the guide at</FONT>
-<BR><FONT COLOR="#CC0000">//// http://www.cs.wustl.edu/~schmidt/ACE.html</FONT>
-<BR><FONT COLOR="#CC0000">////&nbsp; AUTHOR: Umar Syyid (usyyid@hns.com)</FONT>
-<BR><FONT COLOR="#CC0000">//// and Ambreen Ilyas (ambreen@bitsmart.com)</FONT>
-<BR><FONT COLOR="#CC0000">/////////////////////////////////////////////////////////////////////////////////////////////////////////////</FONT>
-
-<P><FONT COLOR="#CC0000">//Example 5</FONT>
-<BR><FONT COLOR="#000099">#include</FONT> <FONT COLOR="#006600">"ace/Reactor.h"</FONT>
-<BR><FONT COLOR="#000099">#include</FONT> <FONT COLOR="#006600">"ace/Event_Handler.h"</FONT>
-<BR><FONT COLOR="#000099">#include</FONT> <FONT COLOR="#006600">"ace/Synch_T.h"</FONT>
-<BR><FONT COLOR="#000099">#include</FONT> <FONT COLOR="#006600">"ace/Thread_Manager.h"</FONT>
-
-<P>class My_Handler: public ACE_Event_Handler{
-<BR>public:
-<BR><FONT COLOR="#FF0000">&nbsp;//Start the event handling process.</FONT>
-<BR>&nbsp;My_Handler(){
-<BR>&nbsp; ACE_DEBUG((LM_DEBUG,"Got open\n"));
-<BR>&nbsp; activate_threads();
-<BR>&nbsp; ACE_Reactor::instance()->max_notify_iterations(5);
-<BR>&nbsp; return 0;
-<BR>&nbsp; }
-
-<P><FONT COLOR="#FF0000">//Spawn a separate thread so that it notifies
-the reactor</FONT>
-<BR>&nbsp;void activate_threads(){
-<BR>&nbsp; ACE_Thread_Manager::instance()
-<BR>&nbsp;&nbsp;&nbsp;&nbsp; ->spawn((ACE_THR_FUNC)svc_start,(void*)this);
-<BR>&nbsp; }
-<BR>&nbsp;
-<BR><FONT COLOR="#FF0000">&nbsp;//Notify the Reactor 10 times.</FONT>
-<BR>&nbsp;void svc(){
-<BR>&nbsp; for(int i=0;i&lt;10;i++)
-<BR>&nbsp;&nbsp; ACE_Reactor::instance()
-<BR>&nbsp;&nbsp;&nbsp;&nbsp; ->notify(this, ACE_Event_Handler::READ_MASK);
-<BR>&nbsp;&nbsp; }
-
-<P><FONT COLOR="#FF0000">//The actual handler which in this case will handle
-the notifications</FONT>
-<BR>&nbsp;int handle_input(int){
-<BR>&nbsp; ACE_DEBUG((LM_DEBUG, ?Got notification # %d\n?, no));
-<BR>&nbsp; no++;
-<BR>&nbsp; return 0;
-<BR>&nbsp; }
-
-<P>&nbsp;<FONT COLOR="#FF0000">//The entry point for the new thread that
-is to be created.</FONT>
-<BR>&nbsp;static int svc_start(void* arg);
-<BR>private:
-<BR>&nbsp;static int no;
-<BR>};
-<BR>&nbsp;
-
-<P><FONT COLOR="#FF0000">//Static members</FONT>
-<BR>int My_Handler::no=1;
-<BR>int My_Handler::svc_start(void* arg){
-<BR>&nbsp;My_Handler *eh= (My_Handler*)arg;
-<BR>&nbsp;eh->svc();
-<BR>&nbsp;return -1; <FONT COLOR="#FF0000">//de-register from the reactor</FONT>
-<BR>&nbsp;}
-
-<P>int main(int argc, char *argv[]){
-<BR>&nbsp;ACE_DEBUG((LM_DEBUG,"Starting test \n"));
-<BR>&nbsp;My_Handler handler;
-
-<P>&nbsp;while(1){
-<BR>&nbsp; ACE_Reactor::instance()->handle_events();
-<BR>&nbsp; sleep(3);
-<BR>&nbsp; }
-<BR>}
-<BR>&nbsp;
-<BR>&nbsp;
-<BR>&nbsp; <A HREF="../Chap_6/ex01.html">Next Example</A>
-</BODY>
-</HTML>