diff options
Diffstat (limited to 'docs/tutorials/Chap_5')
-rw-r--r-- | docs/tutorials/Chap_5/Chap_5.zip | bin | 5843 -> 0 bytes | |||
-rw-r--r-- | docs/tutorials/Chap_5/ex01.html | 75 | ||||
-rw-r--r-- | docs/tutorials/Chap_5/ex02.html | 148 | ||||
-rw-r--r-- | docs/tutorials/Chap_5/ex03.html | 86 | ||||
-rw-r--r-- | docs/tutorials/Chap_5/ex04.html | 84 | ||||
-rw-r--r-- | docs/tutorials/Chap_5/ex05.html | 87 |
6 files changed, 0 insertions, 480 deletions
diff --git a/docs/tutorials/Chap_5/Chap_5.zip b/docs/tutorials/Chap_5/Chap_5.zip Binary files differdeleted file mode 100644 index 5eb2b6646d0..00000000000 --- a/docs/tutorials/Chap_5/Chap_5.zip +++ /dev/null diff --git a/docs/tutorials/Chap_5/ex01.html b/docs/tutorials/Chap_5/ex01.html deleted file mode 100644 index 54bb3204b61..00000000000 --- a/docs/tutorials/Chap_5/ex01.html +++ /dev/null @@ -1,75 +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 1</TITLE> -</HEAD> -<BODY> -<FONT COLOR="#CC0000">/////////////////////////////////////////////////////////////////////////////////////////////////////////////////</FONT> -<BR><FONT COLOR="#CC0000">//// This example is from the ACE Programmers -Guide.</FONT> -<BR><FONT COLOR="#CC0000">//// Chapter: "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">//// 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="#FF0000">//Example 1</FONT> -<BR><FONT COLOR="#000099">#include</FONT> <FONT COLOR="#006600"><signal.h></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> - -<P><FONT COLOR="#FF0000">//Create our subclass to handle the signal events</FONT> -<BR><FONT COLOR="#FF0000">//that we wish to handle. Since we know that -this particular</FONT> -<BR><FONT COLOR="#FF0000">//event handler is going to be using signals -we only overload the</FONT> -<BR><FONT COLOR="#FF0000">//handle_signal method.</FONT> - -<P>class -<BR>MyEventHandler: public ACE_Event_Handler{ -<BR>int -<BR>handle_signal(int signum, siginfo_t*,ucontext_t*){ -<BR> switch(signum){ -<BR> case SIGWINCH: -<BR> ACE_DEBUG((LM_DEBUG, "You pressed SIGWINCH \n")); -<BR> break; - -<P> case SIGINT: -<BR> ACE_DEBUG((LM_DEBUG, "You pressed SIGINT \n")); -<BR> break; -<BR> } -<BR> return 0; -<BR> } -<BR>}; - -<P>int main(int argc, char *argv[]){ -<BR><FONT COLOR="#FF0000"> //instantiate the handler</FONT> -<BR> MyEventHandler *eh =new MyEventHandler; - -<P><FONT COLOR="#FF0000">//Register the handler asking to call back when -either SIGWINCH</FONT> -<BR><FONT COLOR="#FF0000">//or SIGINT signals occur. Note that in both -the cases we asked the</FONT> -<BR><FONT COLOR="#FF0000">//Reactor to call back the same Event_Handler -i.e., MyEventHandler.</FONT> -<BR><FONT COLOR="#FF0000">//This is the reason why we had to write a switch -statement in the handle_signal()</FONT> -<BR><FONT COLOR="#FF0000">//method above. Also note that the</FONT> -<BR><FONT COLOR="#FF0000">//ACE_Reactor is being used as a Singleton object -(Singleton pattern)</FONT> - -<P> ACE_Reactor::instance()->register_handler(SIGWINCH,eh); -<BR> ACE_Reactor::instance()->register_handler(SIGINT,eh); -<BR> while(1) -<BR> <FONT COLOR="#FF0000"> //Start the reactors event loop</FONT> -<BR> ACE_Reactor::instance()->handle_events(); -<BR>} - -<P> <A HREF="ex02.html">Next Example</A> -<BR> -</BODY> -</HTML> diff --git a/docs/tutorials/Chap_5/ex02.html b/docs/tutorials/Chap_5/ex02.html deleted file mode 100644 index 89f5094b9c7..00000000000 --- a/docs/tutorials/Chap_5/ex02.html +++ /dev/null @@ -1,148 +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 2</TITLE> -</HEAD> -<BODY> -<FONT COLOR="#CC0000">/////////////////////////////////////////////////////////////////////////////////////////////////////////////////</FONT> -<BR><FONT COLOR="#CC0000">//// This example is from the ACE Programmers -Guide.</FONT> -<BR><FONT COLOR="#CC0000">//// Chapter: "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">//// 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 2</FONT> -<BR><FONT COLOR="#000099">#include</FONT><FONT COLOR="#006600"> "ace/Reactor.h"</FONT> -<BR><FONT COLOR="#000099">#include</FONT> <FONT COLOR="#006600">"ace/SOCK_Acceptor.h"</FONT> -<BR><FONT COLOR="#000099">#define</FONT> <FONT COLOR="#663366">PORT_NO -19998</FONT> -<BR>typedef ACE_SOCK_Acceptor Acceptor; -<BR><FONT COLOR="#FF0000">//forward declaration</FONT> -<BR>class My_Accept_Handler; - -<P>class -<BR>My_Input_Handler: public ACE_Event_Handler{ -<BR>public: -<BR><FONT COLOR="#FF0000"> //Constructor</FONT> -<BR> My_Input_Handler(){ -<BR> ACE_DEBUG((LM_DEBUG,?Constructor\n?); -<BR> } -<BR> -<BR><FONT COLOR="#FF0000"> //Called back to handle any input receieved</FONT> -<BR> int -<BR> handle_input(ACE_HANDLE){ -<BR><FONT COLOR="#FF0000"> //receive the data</FONT> -<BR> peer().recv_n(data,12); -<BR> ACE_DEBUG((LM_DEBUG,?%s\n?,data)); -<BR> -<BR> <FONT COLOR="#FF0000"> // do something with the input received.</FONT> -<BR><FONT COLOR="#FF0000"> // ...</FONT> - -<P><FONT COLOR="#FF0000"> //keep yourself registered with the reactor</FONT> -<BR> return 0; -<BR> } -<BR> -<BR><FONT COLOR="#FF0000"> //Used by the reactor to determine the -underlying handle</FONT> -<BR> ACE_HANDLE -<BR> get_handle()const { -<BR> return this->peer_i().get_handle(); -<BR> } -<BR> -<BR><FONT COLOR="#FF0000"> //Returns a reference to the underlying -stream.</FONT> -<BR> ACE_SOCK_Stream & -<BR> peer_i(){ -<BR> return this->peer_; -<BR> } - -<P>private: -<BR> ACE_SOCK_Stream peer_; -<BR> char data [12]; -<BR>}; -<BR> - -<P>class -<BR>My_Accept_Handler: public ACE_Event_Handler{ -<BR>public: -<BR><FONT COLOR="#FF0000">//Constructor</FONT> -<BR> My_Accept_Handler(ACE_Addr &addr){ -<BR> this->open(addr); -<BR> } - -<P><FONT COLOR="#FF0000">//Open the peer_acceptor so it starts to ?listen?</FONT> -<BR><FONT COLOR="#FF0000">//for incoming clients.</FONT> -<BR> int -<BR> open(ACE_Addr &addr){ -<BR> peer_acceptor.open(addr); -<BR> return 0; -<BR> } - -<P><FONT COLOR="#FF0000">//Overload the handle input method</FONT> -<BR> int -<BR> handle_input(ACE_HANDLE handle){ -<BR> <FONT COLOR="#FF0000"> //Client has requested connection to server.</FONT> -<BR><FONT COLOR="#FF0000"> //Create a handler to handle the connection</FONT> -<BR> My_Input_Handler *eh= new My_Input_Handler(); - -<P> <FONT COLOR="#FF0000">//Accept the connection ?into? the Event -Handler</FONT> -<BR> if (this->peer_acceptor.accept (eh->peer (), <FONT COLOR="#FF0000">// -stream</FONT> -<BR> 0, <FONT COLOR="#FF0000">// remote address</FONT> -<BR> 0, <FONT COLOR="#FF0000">// timeout</FONT> -<BR> 1) ==-1) <FONT COLOR="#FF0000">//restart -if interrupted</FONT> -<BR> ACE_DEBUG((LM_ERROR,"Error in connection\n")); - -<P> ACE_DEBUG((LM_DEBUG,"Connection established\n")); - -<P><FONT COLOR="#FF0000"> //Register the input event handler for -reading</FONT> -<BR> ACE_Reactor::instance()-> -<BR> register_handler(eh,ACE_Event_Handler::READ_MASK); - -<P><FONT COLOR="#FF0000"> //Unregister as the acceptor is not expecting -new clients</FONT> -<BR> return -1; -<BR> } - -<P><FONT COLOR="#FF6666"> //Used by the reactor to determine the underlying -handle</FONT> -<BR> ACE_HANDLE -<BR> get_handle(void) const{ -<BR> return this->peer_acceptor.get_handle(); -<BR> } -<BR>private: -<BR> Acceptor peer_acceptor; -<BR>}; - -<P>int main(int argc, char * argv[]){ -<BR><FONT COLOR="#FF0000"> //Create an address on which to receive -connections</FONT> -<BR> ACE_INET_Addr addr(PORT_NO); - -<P><FONT COLOR="#FF0000">//Create the Accept Handler which automatically -begins to "listen"</FONT> -<BR><FONT COLOR="#FF0000">//for client requests for connections</FONT> -<BR> My_Accept_Handler *eh=new My_Accept_Handler(addr); - -<P><FONT COLOR="#FF0000">//Register the reactor to call back when incoming -client connects</FONT> -<BR>ACE_Reactor::instance()->register_handler(eh, -<BR> ACE_Event_Handler::ACCEPT_MASK); - -<P><FONT COLOR="#FF0000">//Start the event loop</FONT> -<BR>while(1) -<BR> ACE_Reactor::instance()->handle_events(); -<BR>} - -<P> <A HREF="ex03.html">Next Example</A> -</BODY> -</HTML> diff --git a/docs/tutorials/Chap_5/ex03.html b/docs/tutorials/Chap_5/ex03.html deleted file mode 100644 index 07dabd17a97..00000000000 --- a/docs/tutorials/Chap_5/ex03.html +++ /dev/null @@ -1,86 +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 3</TITLE> -</HEAD> -<BODY> -<FONT COLOR="#CC0000">/////////////////////////////////////////////////////////////////////////////////////////////////////////////////</FONT> -<BR><FONT COLOR="#CC0000">//// This example is from the ACE Programmers -Guide.</FONT> -<BR><FONT COLOR="#CC0000">//// Chapter: "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">//// 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="#FF0000">//Example 3</FONT> -<BR><FONT COLOR="#000099">#include</FONT> "<FONT COLOR="#006600">ace/Timer_Queue.h"</FONT> -<BR><FONT COLOR="#000099">#include</FONT> "<FONT COLOR="#006600">ace/Reactor.h"</FONT> -<BR><FONT COLOR="#000099">#define</FONT> <FONT COLOR="#663366">NUMBER_TIMERS -10</FONT> - -<P>static int done = 0; -<BR>static int count = 0; - -<P>class Time_Handler : public ACE_Event_Handler -<BR>{ -<BR>public: -<BR> <FONT COLOR="#FF0000">//Method which is called back by the Reactor -when timeout occurs.</FONT> -<BR> virtual int handle_timeout (const ACE_Time_Value &tv, -<BR> const void *arg){ -<BR> long current_count = long (arg); -<BR> ACE_ASSERT (current_count == count); -<BR> ACE_DEBUG ((LM_DEBUG, "%d: Timer #%d timed out at %d!\n", -<BR> count, current_count, tv.sec())); -<BR> - -<P><FONT COLOR="#FF0000">//Increment count</FONT> -<BR> count ++; - -<P><FONT COLOR="#FF0000">//Make sure assertion doesnt fail for missing -5th timer.</FONT> -<BR> if (count ==5) -<BR> count++; -<BR> -<BR><FONT COLOR="#FF0000"> //If all timers done then set done flag</FONT> -<BR> if (current_count == NUMBER_TIMERS - 1) -<BR> done = 1; -<BR><FONT COLOR="#FF0000"> //Keep yourself registered with the Reactor.</FONT> -<BR> return 0; -<BR> } -<BR>}; - -<P>int -<BR>main (int, char *[]) -<BR>{ -<BR> ACE_Reactor reactor; -<BR> Time_Handler *th=new Time_Handler; -<BR> int timer_id[NUMBER_TIMERS]; -<BR> int i; - -<P> for (i = 0; i < NUMBER_TIMERS; i++) -<BR> timer_id[i] = reactor.schedule_timer (th, -<BR> (const void *) i, <FONT COLOR="#FF0000">// argument sent -to handle_timeout()</FONT> -<BR> ACE_Time_Value (2 * i + 1));<FONT COLOR="#FF0000"> //set -timer to go off with delay</FONT> - -<P><FONT COLOR="#CC0000"> //Cancel the fifth timer before it goes -off</FONT> -<BR> reactor.cancel_timer(timer_id[5]);<FONT COLOR="#FF0000">//Timer -ID of timer to be removed</FONT> - -<P> while (!done) -<BR> reactor.handle_events (); - -<P> return 0; -<BR>} - -<P> <A HREF="ex04.html">Next Example</A> -</BODY> -</HTML> diff --git a/docs/tutorials/Chap_5/ex04.html b/docs/tutorials/Chap_5/ex04.html deleted file mode 100644 index e0d0181d14d..00000000000 --- a/docs/tutorials/Chap_5/ex04.html +++ /dev/null @@ -1,84 +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 4</TITLE> -</HEAD> -<BODY> -<FONT COLOR="#CC0000">/////////////////////////////////////////////////////////////////////////////////////////////////////////////////</FONT> -<BR><FONT COLOR="#CC0000">//// This example is from the ACE Programmers -Guide.</FONT> -<BR><FONT COLOR="#CC0000">//// Chapter: "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">//// 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="#FF0000">//Example 4</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> -<BR><FONT COLOR="#000099">#define</FONT> <FONT COLOR="#663366">WAIT_TIME -1</FONT> -<BR><FONT COLOR="#000099">#define</FONT><FONT COLOR="#663366"> SLEEP_TIME -2</FONT> - -<P>class My_Handler: public ACE_Event_Handler{ -<BR> public: - -<P><FONT COLOR="#FF0000"> //Start the event handling process.</FONT> -<BR> My_Handler(){ -<BR> ACE_DEBUG((LM_DEBUG,"Event Handler created\n")); -<BR> ACE_Reactor::instance()->max_notify_iterations(5); -<BR> return 0; -<BR> } - -<P><FONT COLOR="#FF0000">//Perform the notifications i.e., notify the reactor -10 times</FONT> -<BR> void perform_notifications(){ -<BR> for(int i=0;i<10;i++) -<BR> ACE_Reactor::instance()-> -<BR> notify(this,ACE_Event_Handler::READ_MASK); -<BR> } -<BR> -<BR><FONT COLOR="#FF0000"> //The actual handler which in this case -will handle the notifications</FONT> -<BR> int handle_input(int){ -<BR> ACE_DEBUG((LM_DEBUG,"Got notification # %d\n",no)); -<BR> no++; -<BR> return 0; -<BR> } -<BR>private: -<BR> static int no; -<BR>}; - -<P><FONT COLOR="#FF0000">//Static members</FONT> -<BR>int My_Handler::no=1; -<BR> - -<P>int main(int argc, char *argv[]){ -<BR><FONT COLOR="#FF0000"> //Instantiating the handler</FONT> -<BR> My_Handler handler; -<BR> -<BR><FONT COLOR="#FF0000"> //The done flag is set to not done yet.</FONT> -<BR> int done=0; - -<P>while(1){ -<BR> <FONT COLOR="#FF0000"> //After WAIT_TIME the handle_events will -fall through if no events arrive.</FONT> -<BR> ACE_Reactor::instance()->handle_events(ACE_Time_Value(WAIT_TIME)); -<BR> if(!done){ -<BR> handler.perform_notifications(); -<BR> done=1; -<BR> } -<BR> sleep(SLEEP_TIME); -<BR> } -<BR>} - -<P> <A HREF="ex05.html">Next Example</A> -</BODY> -</HTML> 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">//// Chapter: "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">//// 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"> //Start the event handling process.</FONT> -<BR> My_Handler(){ -<BR> ACE_DEBUG((LM_DEBUG,"Got open\n")); -<BR> activate_threads(); -<BR> ACE_Reactor::instance()->max_notify_iterations(5); -<BR> return 0; -<BR> } - -<P><FONT COLOR="#FF0000">//Spawn a separate thread so that it notifies -the reactor</FONT> -<BR> void activate_threads(){ -<BR> ACE_Thread_Manager::instance() -<BR> ->spawn((ACE_THR_FUNC)svc_start,(void*)this); -<BR> } -<BR> -<BR><FONT COLOR="#FF0000"> //Notify the Reactor 10 times.</FONT> -<BR> void svc(){ -<BR> for(int i=0;i<10;i++) -<BR> ACE_Reactor::instance() -<BR> ->notify(this, ACE_Event_Handler::READ_MASK); -<BR> } - -<P><FONT COLOR="#FF0000">//The actual handler which in this case will handle -the notifications</FONT> -<BR> int handle_input(int){ -<BR> ACE_DEBUG((LM_DEBUG, ?Got notification # %d\n?, no)); -<BR> no++; -<BR> return 0; -<BR> } - -<P> <FONT COLOR="#FF0000">//The entry point for the new thread that -is to be created.</FONT> -<BR> static int svc_start(void* arg); -<BR>private: -<BR> static int no; -<BR>}; -<BR> - -<P><FONT COLOR="#FF0000">//Static members</FONT> -<BR>int My_Handler::no=1; -<BR>int My_Handler::svc_start(void* arg){ -<BR> My_Handler *eh= (My_Handler*)arg; -<BR> eh->svc(); -<BR> return -1; <FONT COLOR="#FF0000">//de-register from the reactor</FONT> -<BR> } - -<P>int main(int argc, char *argv[]){ -<BR> ACE_DEBUG((LM_DEBUG,"Starting test \n")); -<BR> My_Handler handler; - -<P> while(1){ -<BR> ACE_Reactor::instance()->handle_events(); -<BR> sleep(3); -<BR> } -<BR>} -<BR> -<BR> -<BR> <A HREF="../Chap_6/ex01.html">Next Example</A> -</BODY> -</HTML> |