diff options
author | jcej <jcej@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-10-20 02:05:16 +0000 |
---|---|---|
committer | jcej <jcej@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-10-20 02:05:16 +0000 |
commit | 2ae14b2b85ad813a269e8a5529aa76cf984fa8a5 (patch) | |
tree | bafa76246f16ad4d1b7d54baccaf335a7f44d7c2 /docs/tutorials/015/Compressor.h | |
parent | fbacb099c89a0c51a37d632322e1f8952937eda8 (diff) | |
download | ATCD-2ae14b2b85ad813a269e8a5529aa76cf984fa8a5.tar.gz |
*** empty log message ***
Diffstat (limited to 'docs/tutorials/015/Compressor.h')
-rw-r--r-- | docs/tutorials/015/Compressor.h | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/docs/tutorials/015/Compressor.h b/docs/tutorials/015/Compressor.h index f1310432841..bc0257b16d1 100644 --- a/docs/tutorials/015/Compressor.h +++ b/docs/tutorials/015/Compressor.h @@ -6,27 +6,38 @@ #include "Protocol_Task.h" -class ACE_SOCK_Stream; - +/* A reallly dumb compression object. (It actually adds 3 bytes to + every message block.) +*/ class Compressor : public Protocol_Task { public: typedef Protocol_Task inherited; - + + // I've given you the option of creating this task derivative + // with a number of threads. In retro-spect that really isn't + // a good idea. Most client/server systems rely on requests + // and responses happening in a predicatable order. Introduce + // a thread pool and message queue and that ordering goes + // right out the window. In other words: Don't ever use the + // constructor parameter! Compressor( int _thr_count = 0 ); + ~Compressor(void); protected: + // This is called when the compressor is on the downstream + // side. We'll take the message, compress it and move it + // along to the next module. int send(ACE_Message_Block *message, ACE_Time_Value *timeout); + // This one is called on the upstream side. No surprise: we + // decompress the data and send it on up the stream. int recv(ACE_Message_Block *message, ACE_Time_Value *timeout); - -private: - mode_t mode_; }; #endif // COMPRESSOR_H |