diff options
author | jcej <jcej@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-01-28 00:08:26 +0000 |
---|---|---|
committer | jcej <jcej@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-01-28 00:08:26 +0000 |
commit | e96dfdcad25ad990f129db5c105550031e7b67c8 (patch) | |
tree | ddff5f72faedd18262d8421f1c9dc6cd31cb582d | |
parent | fd530b49d1f2e24cc166dc66b1f8439e0d59aee6 (diff) | |
download | ATCD-e96dfdcad25ad990f129db5c105550031e7b67c8.tar.gz |
*** empty log message ***
-rw-r--r-- | ChangeLog-99b | 8 | ||||
-rw-r--r-- | docs/tutorials/008/combine.shar | 12 | ||||
-rw-r--r-- | docs/tutorials/008/directed_client.cpp | 10 | ||||
-rw-r--r-- | docs/tutorials/008/page03.html | 10 | ||||
-rw-r--r-- | docs/tutorials/008/page04.html | 2 | ||||
-rw-r--r-- | docs/tutorials/009/directed_client.cpp | 10 | ||||
-rw-r--r-- | docs/tutorials/009/page03.html | 10 | ||||
-rw-r--r-- | docs/tutorials/011/combine.shar | 34 | ||||
-rw-r--r-- | docs/tutorials/011/page01.html | 10 | ||||
-rw-r--r-- | docs/tutorials/011/page06.html | 3 | ||||
-rw-r--r-- | docs/tutorials/012/combine.shar | 31 | ||||
-rw-r--r-- | docs/tutorials/012/page01.html | 15 | ||||
-rw-r--r-- | docs/tutorials/012/page05.html | 18 | ||||
-rw-r--r-- | docs/tutorials/012/task.h | 18 |
14 files changed, 149 insertions, 42 deletions
diff --git a/ChangeLog-99b b/ChangeLog-99b index 2cf3d983d62..223f2d002cc 100644 --- a/ChangeLog-99b +++ b/ChangeLog-99b @@ -1,3 +1,11 @@ +Wed Jan 27 19:12:48 1999 James CE Johnson <jcej@chiroptera.tragus.org> + + * docs/tutorials/008/*: + * docs/tutorials/009/*: + * docs/tutorials/011/*: + * docs/tutorials/012/*: + Updates from the reviewers. + Wed Jan 27 17:06:38 1999 David L. Levine <levine@cs.wustl.edu> * ace/Makefile: removed some unprintable characters. diff --git a/docs/tutorials/008/combine.shar b/docs/tutorials/008/combine.shar index a9156df99ad..f12ae4c4ee3 100644 --- a/docs/tutorials/008/combine.shar +++ b/docs/tutorials/008/combine.shar @@ -3,7 +3,7 @@ # To extract the files from this archive, save it to some FILE, remove # everything before the `!/bin/sh' line above, then type `sh FILE'. # -# Made on 1999-01-24 15:11 EST by <jcej@chiroptera.tragus.org>. +# Made on 1999-01-26 19:48 EST by <jcej@chiroptera.tragus.org>. # Source directory was `/var/home/jcej/projects/ACE_wrappers/docs/tutorials/008'. # # Existing files will *not* be overwritten unless `-c' is specified. @@ -67,7 +67,7 @@ else fi rm -f 1231235999 $$.touch # -if mkdir _sh23993; then +if mkdir _sh30434; then $echo 'x -' 'creating lock directory' else $echo 'failed to create lock directory' @@ -441,19 +441,19 @@ enable for this interface.: Unknown error</I>. There are some interfaces seeing here.</BLOCKQUOTE> Ok, one more warning: <blockquote>If you happen to have multiple servers running on your -network when you invoke this client, the resopnse could come from any +network when you invoke this client, the response could come from any one of them. </blockquote> X SHAR_EOF - $shar_touch -am 0124145199 'page04.pst' && + $shar_touch -am 0126194899 'page04.pst' && chmod 0664 'page04.pst' || $echo 'restore of' 'page04.pst' 'failed' if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \ && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then md5sum -c << SHAR_EOF >/dev/null 2>&1 \ || $echo 'page04.pst:' 'MD5 check failed' -0f46660ee6a9e96fe30b7d4901fbdbbe page04.pst +2e01fc6b6638dfa77ed629c0e3e77e21 page04.pst SHAR_EOF else shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'page04.pst'`" @@ -461,5 +461,5 @@ SHAR_EOF $echo 'page04.pst:' 'original size' '1173,' 'current size' "$shar_count!" fi fi -rm -fr _sh23993 +rm -fr _sh30434 exit 0 diff --git a/docs/tutorials/008/directed_client.cpp b/docs/tutorials/008/directed_client.cpp index 208ca249492..998aafa12db 100644 --- a/docs/tutorials/008/directed_client.cpp +++ b/docs/tutorials/008/directed_client.cpp @@ -22,10 +22,16 @@ static const u_short PORT = ACE_DEFAULT_SERVER_PORT; int main(int argc,char *argv[] ) { /* - All datagrams have to have a point of origin. Since we intend to + All datagrams must have a point of origin. Since we intend to transmit instead of receive, we initialize an address with zero and let the OS choose a port for us. We could have chosen our - own value between 1025 and 65535 as long as it isn't already in use. + own value between 1025 and 65535 as long as it isn't already in + use. + + The biggest difference between client and server when datagrams + are used is the fact that servers tend to have a known/fixed + address at which they listen and clients tend to have arbitrary + addresses assigned by the OS. */ ACE_INET_Addr local((u_short)0); diff --git a/docs/tutorials/008/page03.html b/docs/tutorials/008/page03.html index 644a5c478a5..5ba8c36a6a2 100644 --- a/docs/tutorials/008/page03.html +++ b/docs/tutorials/008/page03.html @@ -49,10 +49,16 @@ static const u_short PORT = ACE_DEFAULT_SERVER_PORT; int main(int argc,char *argv[] ) { <font color=red>/* - All datagrams have to have a point of origin. Since we intend to + All datagrams must have a point of origin. Since we intend to transmit instead of receive, we initialize an address with zero and let the OS choose a port for us. We could have chosen our - own value between 1025 and 65535 as long as it isn't already in use. + own value between 1025 and 65535 as long as it isn't already in + use. + + The biggest difference between client and server when datagrams + are used is the fact that servers tend to have a known/fixed + address at which they listen and clients tend to have arbitrary + addresses assigned by the OS. */</font> ACE_INET_Addr local((u_short)0); diff --git a/docs/tutorials/008/page04.html b/docs/tutorials/008/page04.html index 883240e997c..05b28042b63 100644 --- a/docs/tutorials/008/page04.html +++ b/docs/tutorials/008/page04.html @@ -117,7 +117,7 @@ enable for this interface.: Unknown error</I>. There are some interfaces seeing here.</BLOCKQUOTE> Ok, one more warning: <blockquote>If you happen to have multiple servers running on your -network when you invoke this client, the resopnse could come from any +network when you invoke this client, the response could come from any one of them. </blockquote> diff --git a/docs/tutorials/009/directed_client.cpp b/docs/tutorials/009/directed_client.cpp index b15dbab45d7..c90ee80599d 100644 --- a/docs/tutorials/009/directed_client.cpp +++ b/docs/tutorials/009/directed_client.cpp @@ -46,6 +46,16 @@ int main (int argc, char *argv[]) ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "recv"), -1); } + /* + Note: The fourth parameter to recv() is for flags. These flags + are passed directly to the underlying recv() or recvfrom() system + call. For Linux, resonable values are: + MSG_OOB process out-of-band data + MSG_PEEK peek at incoming message (but leave it in the OS buffers) + MSG_WAITALL wait for full request or error + See your system documentation for the gory details. + */ + ACE_DEBUG ((LM_DEBUG, "(%P|%t) The server said (%s)\n", buf)); return (0); diff --git a/docs/tutorials/009/page03.html b/docs/tutorials/009/page03.html index 9da926e3ce5..e6fd2a41313 100644 --- a/docs/tutorials/009/page03.html +++ b/docs/tutorials/009/page03.html @@ -71,6 +71,16 @@ int main (int argc, char *argv[]) ACE_ERROR_RETURN ((LM_ERROR, "<font color=green>%p\n</font>", "<font color=green>recv</font>"), -1); } + <font color=red>/* + Note: The fourth parameter to recv() is for flags. These flags + are passed directly to the underlying recv() or recvfrom() system + call. For Linux, resonable values are: + MSG_OOB process out-of-band data + MSG_PEEK peek at incoming message (but leave it in the OS buffers) + MSG_WAITALL wait for full request or error + See your system documentation for the gory details. + */</font> + ACE_DEBUG ((LM_DEBUG, "<font color=green>(%P|%t) The server said (%s)\n</font>", buf)); return (0); diff --git a/docs/tutorials/011/combine.shar b/docs/tutorials/011/combine.shar index 9ad5f87a06e..1518d9c8a73 100644 --- a/docs/tutorials/011/combine.shar +++ b/docs/tutorials/011/combine.shar @@ -3,7 +3,7 @@ # To extract the files from this archive, save it to some FILE, remove # everything before the `!/bin/sh' line above, then type `sh FILE'. # -# Made on 1999-01-24 15:53 EST by <jcej@chiroptera.tragus.org>. +# Made on 1999-01-26 20:13 EST by <jcej@chiroptera.tragus.org>. # Source directory was `/var/home/jcej/projects/ACE_wrappers/docs/tutorials/011'. # # Existing files will *not* be overwritten unless `-c' is specified. @@ -13,12 +13,12 @@ # ------ ---------- ------------------------------------------ # 442 -rw-rw-r-- hdr # 48 -rw-rw-r-- bodies -# 439 -rw-rw-r-- page01.pre +# 869 -rw-rw-r-- page01.pre # 164 -rw-rw-r-- page02.pre # 174 -rw-rw-r-- page03.pre # 127 -rw-rw-r-- page04.pre # 2691 -rw-rw-r-- page05.pre -# 706 -rw-rw-r-- page06.pre +# 707 -rw-rw-r-- page06.pre # 351 -rw-rw-r-- page02.pst # 208 -rw-rw-r-- page03.pst # 129 -rw-rw-r-- page04.pst @@ -68,7 +68,7 @@ else fi rm -f 1231235999 $$.touch # -if mkdir _sh24921; then +if mkdir _sh31079; then $echo 'x -' 'creating lock directory' else $echo 'failed to create lock directory' @@ -151,20 +151,30 @@ cases you'll need to move complex data structures between your threads. In this tutorial I'll expand the previous by moving not only a text string but also a more complex object. In the next tutorial I'll change things again so that we move the complex object a bit more efficiently. +<P> +A simple abstract for a simple tutorial: +<UL> +In this tutorial, we put some data into the blocks of the message queue. +We copy the data from a Data object into the block and put it on the +queue. The block is then dequeued by the thread which picks it up and +processes it. This tutorial is very similar to the previous +one with the extra touch being population of the blocks with data. +</UL> +(Abstract by Kirthika, as always.) SHAR_EOF - $shar_touch -am 0124154699 'page01.pre' && + $shar_touch -am 0126201399 'page01.pre' && chmod 0664 'page01.pre' || $echo 'restore of' 'page01.pre' 'failed' if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \ && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then md5sum -c << SHAR_EOF >/dev/null 2>&1 \ || $echo 'page01.pre:' 'MD5 check failed' -b6861097131264d54a36a9a204a4da82 page01.pre +58768929bbe513a9fa2302b1fe3170be page01.pre SHAR_EOF else shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'page01.pre'`" - test 439 -eq "$shar_count" || - $echo 'page01.pre:' 'original size' '439,' 'current size' "$shar_count!" + test 869 -eq "$shar_count" || + $echo 'page01.pre:' 'original size' '869,' 'current size' "$shar_count!" fi fi # ============= page02.pre ============== @@ -380,12 +390,12 @@ SHAR_EOF && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then md5sum -c << SHAR_EOF >/dev/null 2>&1 \ || $echo 'page06.pre:' 'MD5 check failed' -9b6fcd60df274cb70fc8334580f3ccbc page06.pre +17d64bbe275773a80d7d767e04e0474c page06.pre SHAR_EOF else shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'page06.pre'`" - test 706 -eq "$shar_count" || - $echo 'page06.pre:' 'original size' '706,' 'current size' "$shar_count!" + test 707 -eq "$shar_count" || + $echo 'page06.pre:' 'original size' '707,' 'current size' "$shar_count!" fi fi # ============= page02.pst ============== @@ -472,5 +482,5 @@ SHAR_EOF $echo 'page04.pst:' 'original size' '129,' 'current size' "$shar_count!" fi fi -rm -fr _sh24921 +rm -fr _sh31079 exit 0 diff --git a/docs/tutorials/011/page01.html b/docs/tutorials/011/page01.html index 78fc4cf5e35..8df08d2cd08 100644 --- a/docs/tutorials/011/page01.html +++ b/docs/tutorials/011/page01.html @@ -21,5 +21,15 @@ cases you'll need to move complex data structures between your threads. In this tutorial I'll expand the previous by moving not only a text string but also a more complex object. In the next tutorial I'll change things again so that we move the complex object a bit more efficiently. +<P> +A simple abstract for a simple tutorial: +<UL> +In this tutorial, we put some data into the blocks of the message queue. +We copy the data from a Data object into the block and put it on the +queue. The block is then dequeued by the thread which picks it up and +processes it. This tutorial is very similar to the previous +one with the extra touch being population of the blocks with data. +</UL> +(Abstract by Kirthika, as always.) <P><HR WIDTH="100%"> <CENTER>[<A HREF="../online-tutorials.html">Tutorial Index</A>] [<A HREF="page02.html">Continue This Tutorial</A>]</CENTER> diff --git a/docs/tutorials/011/page06.html b/docs/tutorials/011/page06.html index 36621e53210..99f0c6632ff 100644 --- a/docs/tutorials/011/page06.html +++ b/docs/tutorials/011/page06.html @@ -30,5 +30,6 @@ minimum. In the next tutorial I'll show you a way to do that. </UL> * data.h hasn't changed at all from Tutorial 7 so I didn't devote a - page to it.<P><HR WIDTH="100%"> + page to it. +<P><HR WIDTH="100%"> <CENTER>[<A HREF="../online-tutorials.html">Tutorial Index</A>] </CENTER> diff --git a/docs/tutorials/012/combine.shar b/docs/tutorials/012/combine.shar index 860a94f3ce5..c494cc309be 100644 --- a/docs/tutorials/012/combine.shar +++ b/docs/tutorials/012/combine.shar @@ -3,7 +3,7 @@ # To extract the files from this archive, save it to some FILE, remove # everything before the `!/bin/sh' line above, then type `sh FILE'. # -# Made on 1999-01-24 16:08 EST by <jcej@chiroptera.tragus.org>. +# Made on 1999-01-26 20:15 EST by <jcej@chiroptera.tragus.org>. # Source directory was `/var/home/jcej/projects/ACE_wrappers/docs/tutorials/012'. # # Existing files will *not* be overwritten unless `-c' is specified. @@ -13,7 +13,7 @@ # ------ ---------- ------------------------------------------ # 430 -rw-rw-r-- hdr # 56 -rw-rw-r-- bodies -# 487 -rw-rw-r-- page01.pre +# 1093 -rw-rw-r-- page01.pre # 263 -rw-rw-r-- page02.pre # 397 -rw-rw-r-- page03.pre # 154 -rw-rw-r-- page04.pre @@ -69,7 +69,7 @@ else fi rm -f 1231235999 $$.touch # -if mkdir _sh25217; then +if mkdir _sh31139; then $echo 'x -' 'creating lock directory' else $echo 'failed to create lock directory' @@ -156,20 +156,35 @@ What we'll do in this tutorial is specialize the ACE_Message_Block object so that it can carry our data more efficiently. As you'll see, this isn't very difficult at all. <P> +Kirthika's abstract: +<UL> +Here, a Message_Block class is derived from ACE_Message_Block and is +used to hold a pointer to the object of class Work. Also, the block has +a header containing text. This example simply illustrates a cleaner way +of utilizing Message_Blocks to store objects rather than copying their +contents. +<P> +The ACE_Barrier class has been used in the Task class which blocks the +threads until all of them are rearing to go and grab a block from the +queue and process it. +<P> +Thus a message queue can be used to accomplish a variety of tasks by +storing a object pointer in the blocks. +</UL> SHAR_EOF - $shar_touch -am 0124160599 'page01.pre' && + $shar_touch -am 0126201599 'page01.pre' && chmod 0664 'page01.pre' || $echo 'restore of' 'page01.pre' 'failed' if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \ && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then md5sum -c << SHAR_EOF >/dev/null 2>&1 \ || $echo 'page01.pre:' 'MD5 check failed' -9c50f824bc7cf43d3c8c33fe007a9288 page01.pre +5e7f58b50e75c303325b71866a2a4a4a page01.pre SHAR_EOF else shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'page01.pre'`" - test 487 -eq "$shar_count" || - $echo 'page01.pre:' 'original size' '487,' 'current size' "$shar_count!" + test 1093 -eq "$shar_count" || + $echo 'page01.pre:' 'original size' '1093,' 'current size' "$shar_count!" fi fi # ============= page02.pre ============== @@ -447,5 +462,5 @@ SHAR_EOF $echo 'page05.pst:' 'original size' '449,' 'current size' "$shar_count!" fi fi -rm -fr _sh25217 +rm -fr _sh31139 exit 0 diff --git a/docs/tutorials/012/page01.html b/docs/tutorials/012/page01.html index c2c2021b217..f54792048d4 100644 --- a/docs/tutorials/012/page01.html +++ b/docs/tutorials/012/page01.html @@ -24,5 +24,20 @@ What we'll do in this tutorial is specialize the ACE_Message_Block object so that it can carry our data more efficiently. As you'll see, this isn't very difficult at all. <P> +Kirthika's abstract: +<UL> +Here, a Message_Block class is derived from ACE_Message_Block and is +used to hold a pointer to the object of class Work. Also, the block has +a header containing text. This example simply illustrates a cleaner way +of utilizing Message_Blocks to store objects rather than copying their +contents. +<P> +The ACE_Barrier class has been used in the Task class which blocks the +threads until all of them are rearing to go and grab a block from the +queue and process it. +<P> +Thus a message queue can be used to accomplish a variety of tasks by +storing a object pointer in the blocks. +</UL> <P><HR WIDTH="100%"> <CENTER>[<A HREF="../online-tutorials.html">Tutorial Index</A>] [<A HREF="page02.html">Continue This Tutorial</A>]</CENTER> diff --git a/docs/tutorials/012/page05.html b/docs/tutorials/012/page05.html index 593fda6615b..7507452dac4 100644 --- a/docs/tutorials/012/page05.html +++ b/docs/tutorials/012/page05.html @@ -47,16 +47,24 @@ class Task : public ACE_Task < ACE_MT_SYNCH > { public: - typedef ACE_Task < ACE_MT_SYNCH > inherited; + typedef ACE_Task < ACE_MT_SYNCH > inherited; Task (void); - ~Task (void); + ~Task (void); - int open (int threads = 1); + <font color=red>// Some compilers complain when we don't overload all</font> + <font color=red>// baseclass signatures of a method. <sigh></font> + virtual int open ( void * args ) + { + return -1; + } - int svc (void); + <font color=red>// This is the open() we really want our clients to use.</font> + int open (int threads = 1); - int close (u_long flags = 0); + virtual int svc (void); + + virtual int close (u_long flags = 0); protected: ACE_Barrier * barrier_; diff --git a/docs/tutorials/012/task.h b/docs/tutorials/012/task.h index 877ac98ede5..2fea3f7fdab 100644 --- a/docs/tutorials/012/task.h +++ b/docs/tutorials/012/task.h @@ -24,16 +24,24 @@ class Task : public ACE_Task < ACE_MT_SYNCH > { public: - typedef ACE_Task < ACE_MT_SYNCH > inherited; + typedef ACE_Task < ACE_MT_SYNCH > inherited; Task (void); - ~Task (void); + ~Task (void); - int open (int threads = 1); + // Some compilers complain when we don't overload all + // baseclass signatures of a method. <sigh> + virtual int open ( void * args ) + { + return -1; + } - int svc (void); + // This is the open() we really want our clients to use. + int open (int threads = 1); - int close (u_long flags = 0); + virtual int svc (void); + + virtual int close (u_long flags = 0); protected: ACE_Barrier * barrier_; |