diff options
Diffstat (limited to 'docs/tutorials/015')
-rw-r--r-- | docs/tutorials/015/Client.h | 11 | ||||
-rw-r--r-- | docs/tutorials/015/Compressor.h | 8 | ||||
-rw-r--r-- | docs/tutorials/015/Crypt.h | 2 | ||||
-rw-r--r-- | docs/tutorials/015/Handler.h | 7 | ||||
-rw-r--r-- | docs/tutorials/015/Protocol_Stream.h | 11 | ||||
-rw-r--r-- | docs/tutorials/015/Protocol_Task.h | 14 | ||||
-rw-r--r-- | docs/tutorials/015/Recv.h | 4 | ||||
-rw-r--r-- | docs/tutorials/015/Server.h | 7 | ||||
-rw-r--r-- | docs/tutorials/015/Xmit.h | 6 |
9 files changed, 47 insertions, 23 deletions
diff --git a/docs/tutorials/015/Client.h b/docs/tutorials/015/Client.h index 63d22b03f73..c9f4e496bf2 100644 --- a/docs/tutorials/015/Client.h +++ b/docs/tutorials/015/Client.h @@ -5,6 +5,11 @@ #define CLIENT_H #include "ace/SOCK_Stream.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + #include "Protocol_Stream.h" class ACE_Message_Block; @@ -41,11 +46,11 @@ public: int get( ACE_Message_Block * & _response ); private: - // Protocol_Stream hides the protocol conformance details from + // Protocol_Stream hides the protocol conformance details from // us. Protocol_Stream stream_; - // We create a connection on the peer_ and then pass ownership + // We create a connection on the peer_ and then pass ownership // of it to the protocol stream. ACE_SOCK_Stream peer_; @@ -54,7 +59,7 @@ private: const char * server_; // Accessors for the complex member variables. - + Protocol_Stream & stream(void) { return this->stream_; diff --git a/docs/tutorials/015/Compressor.h b/docs/tutorials/015/Compressor.h index bc0257b16d1..4aaa83144ed 100644 --- a/docs/tutorials/015/Compressor.h +++ b/docs/tutorials/015/Compressor.h @@ -12,18 +12,18 @@ 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 + // 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 + // 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: diff --git a/docs/tutorials/015/Crypt.h b/docs/tutorials/015/Crypt.h index 7a38e1bdb52..c7fb1d5948f 100644 --- a/docs/tutorials/015/Crypt.h +++ b/docs/tutorials/015/Crypt.h @@ -18,7 +18,7 @@ public: // Again we have the option of multiple threads and again I // regret tempting folks to use it. Crypt( int _thr_count = 0 ); - + ~Crypt(void); protected: diff --git a/docs/tutorials/015/Handler.h b/docs/tutorials/015/Handler.h index 7e3123f7cf2..73aa2573b0c 100644 --- a/docs/tutorials/015/Handler.h +++ b/docs/tutorials/015/Handler.h @@ -5,6 +5,11 @@ #define HANDLER_H #include "ace/Svc_Handler.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + #include "ace/SOCK_Stream.h" #include "Protocol_Stream.h" @@ -33,7 +38,7 @@ public: // differences between destroy() and close() so don't try to // use either for all cases. int close (u_long); - + protected: // Respond to peer() activity. diff --git a/docs/tutorials/015/Protocol_Stream.h b/docs/tutorials/015/Protocol_Stream.h index 384e7240e4f..686d39126e0 100644 --- a/docs/tutorials/015/Protocol_Stream.h +++ b/docs/tutorials/015/Protocol_Stream.h @@ -5,6 +5,11 @@ #define PROTOCOL_STREAM_H #include "ace/SOCK_Stream.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + #include "ace/Stream.h" // Shorthand for the stream. @@ -46,18 +51,18 @@ public: _timeout = 0 ); // Tell the Recv task to read some data and send it upstream. - // The data will pass through the protocol tasks and be queued + // The data will pass through the protocol tasks and be queued // into the stream head reader task's message queue. If // you've installed a _reader in open() then that task's // recv() method will see the message and may consume it // instead of passing it to the stream head for queueing. int get(void); - + ACE_SOCK_Stream & peer(void) { return this->peer_; } - + private: // Our peer connection ACE_SOCK_Stream peer_; diff --git a/docs/tutorials/015/Protocol_Task.h b/docs/tutorials/015/Protocol_Task.h index eeec1d71588..194809327ec 100644 --- a/docs/tutorials/015/Protocol_Task.h +++ b/docs/tutorials/015/Protocol_Task.h @@ -6,6 +6,10 @@ #include "ace/Task.h" +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + /* A typical ACE_Task<> derivative that adds a few things appropriate to protocol stacks. */ @@ -20,13 +24,13 @@ public: // zero and let things proceed serially. You might have a // need, however, for some of your tasks to have their own thread. Protocol_Task( int _thr_count ); - + ~Protocol_Task(void); // open() is invoked when the task is inserted into the stream. virtual int open(void *arg); - // close() is invoked when the stream is closed (flags will be + // close() is invoked when the stream is closed (flags will be // set to '1') and when the svc() method exits (flags will be // '0'). virtual int close(u_long flags); @@ -36,13 +40,13 @@ public: virtual int put(ACE_Message_Block *message, ACE_Time_Value *timeout); - // If you choose to activate the task then this method will be + // If you choose to activate the task then this method will be // doing all of the work. virtual int svc(void); protected: - // Called by put() or svc() as necessary to process a block of + // Called by put() or svc() as necessary to process a block of // data. int process(ACE_Message_Block * message, ACE_Time_Value *timeout); @@ -57,7 +61,7 @@ protected: // the peer. virtual int send(ACE_Message_Block *message, ACE_Time_Value *timeout); - + // Tasks on the reader (upstream) side will be receiving data // that came from the peer. virtual int recv(ACE_Message_Block * message, diff --git a/docs/tutorials/015/Recv.h b/docs/tutorials/015/Recv.h index 4514f816aa9..a7058435bf5 100644 --- a/docs/tutorials/015/Recv.h +++ b/docs/tutorials/015/Recv.h @@ -19,7 +19,7 @@ public: // Give it someone to talk to... Recv( ACE_SOCK_Stream & _peer ); - + ~Recv(void); // Trigger a read from the socket @@ -32,7 +32,7 @@ public: { return this->error_; } - + protected: ACE_SOCK_Stream & peer(void) diff --git a/docs/tutorials/015/Server.h b/docs/tutorials/015/Server.h index 0e6b9f9c9cf..6b1eecf05e5 100644 --- a/docs/tutorials/015/Server.h +++ b/docs/tutorials/015/Server.h @@ -5,6 +5,11 @@ #define SERVER_H #include "ace/Acceptor.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + #include "ace/SOCK_Acceptor.h" #include "Handler.h" @@ -36,7 +41,7 @@ public: int run(void); private: - // This will accept client connection requests and instantiate + // This will accept client connection requests and instantiate // a Handler object for each new connection. Acceptor acceptor_; diff --git a/docs/tutorials/015/Xmit.h b/docs/tutorials/015/Xmit.h index 7d8df91e0ef..097f3afdaba 100644 --- a/docs/tutorials/015/Xmit.h +++ b/docs/tutorials/015/Xmit.h @@ -21,14 +21,14 @@ public: // We must be given a valid peer when constructed. Without that // we don't know who to send data to. Xmit( ACE_SOCK_Stream & _peer ); - + ~Xmit(void); - // As you know, close() will be called in a couple of ways by the + // As you know, close() will be called in a couple of ways by the // ACE framework. We use that opportunity to terminate the // connection to the peer. int close(u_long flags); - + protected: ACE_SOCK_Stream & peer(void) |