diff options
-rw-r--r-- | docs/tutorials/013/block.cpp | 6 | ||||
-rw-r--r-- | docs/tutorials/013/page05.html | 6 | ||||
-rw-r--r-- | docs/tutorials/015/Compressor.cpp | 2 | ||||
-rw-r--r-- | docs/tutorials/015/Crypt.cpp | 2 | ||||
-rw-r--r-- | docs/tutorials/015/Recv.cpp | 2 | ||||
-rw-r--r-- | docs/tutorials/015/Xmit.cpp | 2 | ||||
-rw-r--r-- | docs/tutorials/015/page04.html | 5 | ||||
-rw-r--r-- | docs/tutorials/015/page09.html | 6 | ||||
-rw-r--r-- | docs/tutorials/015/page14.html | 22 | ||||
-rw-r--r-- | docs/tutorials/015/page15.html | 27 | ||||
-rw-r--r-- | docs/tutorials/015/page16.html | 16 | ||||
-rw-r--r-- | docs/tutorials/015/page17.html | 10 | ||||
-rw-r--r-- | docs/tutorials/015/page19.html | 2 | ||||
-rw-r--r-- | docs/tutorials/015/page21.html | 2 |
14 files changed, 51 insertions, 59 deletions
diff --git a/docs/tutorials/013/block.cpp b/docs/tutorials/013/block.cpp index 5d997510244..fcf90598279 100644 --- a/docs/tutorials/013/block.cpp +++ b/docs/tutorials/013/block.cpp @@ -9,7 +9,7 @@ strategy. */ Data_Block::Data_Block (Unit_Of_Work * _data) -: inherited (0, ACE_Message_Block::MB_DATA, 0, 0, new Lock (), 0, 0) +: ACE_Data_Block (0, ACE_Message_Block::MB_DATA, 0, 0, new Lock (), 0, 0) ,data_ (_data) { ACE_DEBUG ((LM_DEBUG, "(%P|%t) 0x%x Data_Block ctor for 0x%x\n", (void *) this, (void *) data_)); @@ -76,7 +76,7 @@ int Data_Block::Lock::release (void) Create an baseclass unit of work when we instantiate a hangup message. */ Message_Block::Message_Block (void) -:inherited (new Data_Block (new Unit_Of_Work ())) +:ACE_Message_Block (new Data_Block (new Unit_Of_Work ())) { ACE_DEBUG ((LM_DEBUG, "(%P|%t) 0x%x Message_Block ctor for shutdown\n", (void *) this)); this->msg_type (MB_HANGUP); @@ -87,7 +87,7 @@ Message_Block::Message_Block (void) that data. */ Message_Block::Message_Block (Unit_Of_Work * _data) -:inherited (new Data_Block (_data)) +:ACE_Message_Block (new Data_Block (_data)) { ACE_DEBUG ((LM_DEBUG, "(%P|%t) 0x%x Message_Block ctor for 0x%x\n", (void *) this, (void *) _data)); } diff --git a/docs/tutorials/013/page05.html b/docs/tutorials/013/page05.html index c258bfcd56a..2d72c34a66d 100644 --- a/docs/tutorials/013/page05.html +++ b/docs/tutorials/013/page05.html @@ -32,7 +32,7 @@ the Data_Block. allow us the use of that space.</i> */ Data_Block::Data_Block( Unit_Of_Work * _data ) - : inherited(0,ACE_Message_Block::MB_DATA,0,0,new Lock(),0,0) + : ACE_Data_Block(0,ACE_Message_Block::MB_DATA,0,0,new Lock(),0,0) ,data_(_data) { ACE_DEBUG ((LM_DEBUG, "(%P|%t) 0x%x Data_Block ctor for 0x%x\n", (void *) this, (void*)data_)); @@ -105,7 +105,7 @@ int Data_Block::Lock::release(void) Create an baseclass unit of work when we instantiate a hangup message. */ Message_Block::Message_Block( void ) - : inherited( new Data_Block( new Unit_Of_Work() ) ) + : ACE_Message_Block( new Data_Block( new Unit_Of_Work() ) ) { ACE_DEBUG ((LM_DEBUG, "(%P|%t) 0x%x Message_Block ctor for shutdown\n", (void *) this )); this->msg_type( MB_HANGUP ); @@ -116,7 +116,7 @@ Message_Block::Message_Block( void ) with that data. */ Message_Block::Message_Block( Unit_Of_Work * _data ) - : inherited( new Data_Block(_data) ) + : ACE_Message_Block( new Data_Block(_data) ) { ACE_DEBUG ((LM_DEBUG, "(%P|%t) 0x%x Message_Block ctor for 0x%x\n", (void *) this, (void*)_data)); } diff --git a/docs/tutorials/015/Compressor.cpp b/docs/tutorials/015/Compressor.cpp index c2f796bd68e..f93d44009de 100644 --- a/docs/tutorials/015/Compressor.cpp +++ b/docs/tutorials/015/Compressor.cpp @@ -8,7 +8,7 @@ should remove this option... */ Compressor::Compressor( int _thr_count ) - : inherited(_thr_count) + : Protocol_Task(_thr_count) { ; } diff --git a/docs/tutorials/015/Crypt.cpp b/docs/tutorials/015/Crypt.cpp index 1e20b8f5b42..1967bbe0ff1 100644 --- a/docs/tutorials/015/Crypt.cpp +++ b/docs/tutorials/015/Crypt.cpp @@ -7,7 +7,7 @@ /* The expected constructor... */ Crypt::Crypt( int _thr_count ) - : inherited(_thr_count) + : Protocol_Task(_thr_count) { } diff --git a/docs/tutorials/015/Recv.cpp b/docs/tutorials/015/Recv.cpp index f2b06875a9a..626d6298290 100644 --- a/docs/tutorials/015/Recv.cpp +++ b/docs/tutorials/015/Recv.cpp @@ -8,7 +8,7 @@ initializations. */ Recv::Recv( ACE_SOCK_Stream & _peer ) - : inherited(0), peer_(_peer), error_(0) + : Protocol_Task(0), peer_(_peer), error_(0) { // Create the tickler that get() will use to trigger recv() // through the baseclass. Since we're single-threaded this is diff --git a/docs/tutorials/015/Xmit.cpp b/docs/tutorials/015/Xmit.cpp index fb80ab8aa34..28cc7055ce6 100644 --- a/docs/tutorials/015/Xmit.cpp +++ b/docs/tutorials/015/Xmit.cpp @@ -12,7 +12,7 @@ cause more trouble than you want to deal with. */ Xmit::Xmit( ACE_SOCK_Stream & _peer ) - : inherited(0), peer_(_peer) + : Protocol_Task(0), peer_(_peer) { } diff --git a/docs/tutorials/015/page04.html b/docs/tutorials/015/page04.html index 6ce78807797..e0f2a7a0974 100644 --- a/docs/tutorials/015/page04.html +++ b/docs/tutorials/015/page04.html @@ -85,10 +85,9 @@ Ok, that's it for the client. We've seen a very simple main() <P> For a quick look back: <UL> -<LI><A HREF="Makefile.client">client Makefile</A> <LI><A HREF="client.cpp">client.cpp</A> -<LI><A HREF="Client_i.h">Client_i.h</A> -<LI><A HREF="Client_i.cpp">Client_i.cpp</A> +<LI><A HREF="Client.h">Client.h</A> +<LI><A HREF="Client.cpp">Client.cpp</A> </UL> <P> Now we'll move on and examine the server counter-part of our client. diff --git a/docs/tutorials/015/page09.html b/docs/tutorials/015/page09.html index 246b24f75d1..6a842298010 100644 --- a/docs/tutorials/015/page09.html +++ b/docs/tutorials/015/page09.html @@ -213,12 +213,12 @@ cause confusion. We're going to discuss that mystery now but before we do here's the list of server files if you want to review: <UL> -<LI><A HREF="Makefile.server">Server Makefile</A> <LI><A HREF="server.cpp">server.cpp</A> -<LI><A HREF="Server_i.h">Server_i.h</A> -<LI><A HREF="Server_i.cpp">Server_i.cpp</A> +<LI><A HREF="Server.h">Server.h</A> +<LI><A HREF="Server.cpp">Server.cpp</A> <LI><A HREF="Handler.h">Handler.h</A> <LI><A HREF="Handler.cpp">Handler.cpp</A> +<LI><A HREF="Makefile.server">Server Makefile</A> </UL> <P> <P><HR WIDTH="100%"> diff --git a/docs/tutorials/015/page14.html b/docs/tutorials/015/page14.html index 7a5016ba090..40c4b3bf3e3 100644 --- a/docs/tutorials/015/page14.html +++ b/docs/tutorials/015/page14.html @@ -12,15 +12,21 @@ <P> <HR WIDTH="100%"> -The Xmit object knows how to send data to the peer. It sits at the -tail of the stream and gets everything that flows down from the head. -In keeping with the spirit of things, this object does only one thing -and doesn't concern itself with anyone else' details. +The implementation of Xmit isn't too complicated. If we choose to +combine it with the Recv task we simply lift the recv() method from +that object and drop it into this one. <P> -The only thing you might want to do is combine it with Recv. Why? -As you'll realize in a page or two, the Xmit and Recv objects must -interact if you're going to ensure a safe transit. By having a single -object it's easier to coordinate and maintain the interaction. +Note that close() must decide if it's being called when the stream is +shutdown or when it's svc() method exits. Since we tell the baseclass +not to use any threads it's a safe bet that flags will always be +non-zero. Still, it's good practice to plan for the future by +checking the value. +<P> +Note also that when we send the data we prefix it with the data size. +This let's our sibling Recv ensure that an entire block is received +together. This can be very important for compression and encryption +processes which typically work better with blocks of data instead of +streams of data. <HR> <PRE> diff --git a/docs/tutorials/015/page15.html b/docs/tutorials/015/page15.html index 708e19b7183..1b8759cb6a2 100644 --- a/docs/tutorials/015/page15.html +++ b/docs/tutorials/015/page15.html @@ -12,21 +12,18 @@ <P> <HR WIDTH="100%"> -The implementation of Xmit isn't too complicated. If we choose to -combine it with the Recv task we simply lift the recv() method from -that object and drop it into this one. +Recv is the sibling to Xmit. Again, they could be combined into a +single object if you want. <P> -Note that close() must decide if it's being called when the stream is -shutdown or when it's svc() method exits. Since we tell the baseclass -not to use any threads it's a safe bet that flags will always be -non-zero. Still, it's good practice to plan for the future by -checking the value. -<P> -Note also that when we send the data we prefix it with the data size. -This let's our sibling Recv ensure that an entire block is received -together. This can be very important for compression and encryption -processes which typically work better with blocks of data instead of -streams of data. +An ACE_Stream is designed to handle downstream traffic very +well. You put() data into it and it flows along towards the tail. +However, there doesn't seem to be a way to put data in such that it +will travel upstream. To get around that, I've added a get() method +to Recv that will trigger a read on the socket. Recv will then put +the data to the next upstream module and we're on our way. As noted +earlier, that data will eventually show up either in the <i>reader</i> +(if installed on the stream open()) or the stream head reader task's +message queue. <HR> <PRE> @@ -43,7 +40,7 @@ streams of data. cause more trouble than you want to deal with. */</font> <font color=#008888>Xmit::Xmit</font>( ACE_SOCK_Stream & _peer ) - : inherited(0), peer_(_peer) + : Protocol_Task(0), peer_(_peer) { } diff --git a/docs/tutorials/015/page16.html b/docs/tutorials/015/page16.html index 620950ad548..5f23b7e4e48 100644 --- a/docs/tutorials/015/page16.html +++ b/docs/tutorials/015/page16.html @@ -12,18 +12,10 @@ <P> <HR WIDTH="100%"> -Recv is the sibling to Xmit. Again, they could be combined into a -single object if you want. -<P> -An ACE_Stream is designed to handle downstream traffic very -well. You put() data into it and it flows along towards the tail. -However, there doesn't seem to be a way to put data in such that it -will travel upstream. To get around that, I've added a get() method -to Recv that will trigger a read on the socket. Recv will then put -the data to the next upstream module and we're on our way. As noted -earlier, that data will eventually show up either in the <i>reader</i> -(if installed on the stream open()) or the stream head reader task's -message queue. +The Recv implementation is nearly as simple as Xmit. There's +opportunity for error when we get the message size and we have to +manage the lifetime of the tickler but other than that it's pretty +basic stuff. <HR> <PRE> diff --git a/docs/tutorials/015/page17.html b/docs/tutorials/015/page17.html index d506014a77d..9dd533b110a 100644 --- a/docs/tutorials/015/page17.html +++ b/docs/tutorials/015/page17.html @@ -12,10 +12,8 @@ <P> <HR WIDTH="100%"> -The Recv implementation is nearly as simple as Xmit. There's -opportunity for error when we get the message size and we have to -manage the lifetime of the tickler but other than that it's pretty -basic stuff. +This and the next three pages present the protocol objects that +provide compression and encryption. If you were hoping to <HR> <PRE> @@ -28,7 +26,7 @@ basic stuff. initializations. */</font> <font color=#008888>Recv::Recv</font>( ACE_SOCK_Stream & _peer ) - : inherited(0), peer_(_peer), error_(0) + : Protocol_Task(0), peer_(_peer), error_(0) { <font color=red>// Create the tickler that get() will use to trigger recv()</font> <font color=red>// through the baseclass. Since we're single-threaded this is</font> @@ -82,7 +80,7 @@ int <font color=#008888>Recv::recv</font>(ACE_Message_Block * message, ACE_Time_ } while( msize[b++] != 0 ); - int size = atoi(msize); + int size = <font color=#008888>ACE_OS::atoi</font>(msize); <font color=red>// Make a block big enough to contain the data we'll read</font> message = new ACE_Message_Block( size ); diff --git a/docs/tutorials/015/page19.html b/docs/tutorials/015/page19.html index 73103ff15bf..3fb5e796d13 100644 --- a/docs/tutorials/015/page19.html +++ b/docs/tutorials/015/page19.html @@ -28,7 +28,7 @@ things more difficult if something has to change in their interaction. should remove this option... */</font> <font color=#008888>Compressor::Compressor</font>( int _thr_count ) - : inherited(_thr_count) + : Protocol_Task(_thr_count) { ; } diff --git a/docs/tutorials/015/page21.html b/docs/tutorials/015/page21.html index 5b017dcf609..eec28051f18 100644 --- a/docs/tutorials/015/page21.html +++ b/docs/tutorials/015/page21.html @@ -26,7 +26,7 @@ favorite library. <font color=red>/* The expected constructor... */</font> <font color=#008888>Crypt::Crypt</font>( int _thr_count ) - : inherited(_thr_count) + : Protocol_Task(_thr_count) { } |