summaryrefslogtreecommitdiff
path: root/examples/IOStream/server
diff options
context:
space:
mode:
authorSteve Huston <shuston@riverace.com>1999-06-25 19:15:12 +0000
committerSteve Huston <shuston@riverace.com>1999-06-25 19:15:12 +0000
commit341a8d8f07b776fed04a164150acfdd279fc326a (patch)
tree5a4ff4170c1552cb438c53c41e681840005dd932 /examples/IOStream/server
parentff7d0d83d7e9be1b6338d52e812582b5e2bbc68c (diff)
downloadATCD-341a8d8f07b776fed04a164150acfdd279fc326a.tar.gz
Move Handler class from iostream_server.cpp to new iostream_server.h.
Diffstat (limited to 'examples/IOStream/server')
-rw-r--r--examples/IOStream/server/iostream_server.cpp38
-rw-r--r--examples/IOStream/server/iostream_server.h50
2 files changed, 52 insertions, 36 deletions
diff --git a/examples/IOStream/server/iostream_server.cpp b/examples/IOStream/server/iostream_server.cpp
index c832ede2b2f..0aad9ba5a77 100644
--- a/examples/IOStream/server/iostream_server.cpp
+++ b/examples/IOStream/server/iostream_server.cpp
@@ -7,47 +7,13 @@
#include "ace/Acceptor.h"
#include "ace/SOCK_Acceptor.h"
#include "ace/Service_Config.h"
-#include "ace/IOStream.h"
+
+#include "iostream_server.h"
ACE_RCSID(server, iostream_server, "$Id$")
#if !defined (ACE_LACKS_ACE_IOSTREAM)
-// Declare a new type which will case an ACE_SOCK_Stream to behave
-// like an iostream. The new ACE_SOCK_IOStream type can be used
-// anywhere an ACE_SOCK_Stream is used.
-
-typedef ACE_IOStream<ACE_SOCK_Stream> ACE_SOCK_IOStream;
-
-// Need to handle brain-dead C++ compilers.
-#if defined (ACE_HAS_TYPENAME_KEYWORD)
-#define ACE_SOCK_IOSTREAM ACE_SOCK_IOStream
-#else
-#define ACE_SOCK_IOSTREAM ACE_SOCK_IOStream, ACE_INET_Addr
-#endif /* ACE_HAS_TYPENAME_KEYWORD */
-
-class Handler : public ACE_Svc_Handler<ACE_SOCK_IOSTREAM, ACE_NULL_SYNCH>
- // = TITLE
- // Extend the <ACE_Svc_Handler> template to do our bidding.
- //
- // = DESCRIPTION
- // Create an <ACE_Svc_Handler> object based on our
- // iostream/SOCK_Stream hybrid. All of this is fairly standard
- // until we get to the <handle_input> where we begin using the
- // iostream characteristics of the peer.
-{
-public:
- // = Initialization and termination methods.
- Handler (void);
- ~Handler (void);
-
- // = <Svc_Handler> hooks.
- virtual int open (void *);
-
- // = <Event_Handler> hooks.
- virtual int handle_input (ACE_HANDLE);
-};
-
int
Handler::open (void *)
{
diff --git a/examples/IOStream/server/iostream_server.h b/examples/IOStream/server/iostream_server.h
new file mode 100644
index 00000000000..9851065a89e
--- /dev/null
+++ b/examples/IOStream/server/iostream_server.h
@@ -0,0 +1,50 @@
+// $Id$
+
+// This file defines the class needed for iostream_server.cpp - it's a separate
+// file to satisfy IBM's xlC template instantiation.
+
+#ifndef __IOSTREAM_SERVER_H
+#define __IOSTREAM_SERVER_H
+
+#include "ace/INET_Addr.h"
+#include "ace/IOStream.h"
+#include "ace/SOCK_Stream.h"
+#include "ace/Svc_Handler.h"
+#include "ace/Synch.h"
+
+// Declare a new type which will case an ACE_SOCK_Stream to behave
+// like an iostream. The new ACE_SOCK_IOStream type can be used
+// anywhere an ACE_SOCK_Stream is used.
+
+typedef ACE_IOStream<ACE_SOCK_Stream> ACE_SOCK_IOStream;
+
+// Need to handle brain-dead C++ compilers.
+#if defined (ACE_HAS_TYPENAME_KEYWORD)
+#define ACE_SOCK_IOSTREAM ACE_SOCK_IOStream
+#else
+#define ACE_SOCK_IOSTREAM ACE_SOCK_IOStream, ACE_INET_Addr
+#endif /* ACE_HAS_TYPENAME_KEYWORD */
+
+class Handler : public ACE_Svc_Handler<ACE_SOCK_IOSTREAM, ACE_NULL_SYNCH>
+ // = TITLE
+ // Extend the <ACE_Svc_Handler> template to do our bidding.
+ //
+ // = DESCRIPTION
+ // Create an <ACE_Svc_Handler> object based on our
+ // iostream/SOCK_Stream hybrid. All of this is fairly standard
+ // until we get to the <handle_input> where we begin using the
+ // iostream characteristics of the peer.
+{
+public:
+ // = Initialization and termination methods.
+ Handler (void);
+ ~Handler (void);
+
+ // = <Svc_Handler> hooks.
+ virtual int open (void *);
+
+ // = <Event_Handler> hooks.
+ virtual int handle_input (ACE_HANDLE);
+};
+
+#endif /* __IOSTREAM_SERVER_H */