summaryrefslogtreecommitdiff
path: root/ACE/examples/APG/Reactor/ClientService.h
diff options
context:
space:
mode:
Diffstat (limited to 'ACE/examples/APG/Reactor/ClientService.h')
-rw-r--r--ACE/examples/APG/Reactor/ClientService.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/ACE/examples/APG/Reactor/ClientService.h b/ACE/examples/APG/Reactor/ClientService.h
new file mode 100644
index 00000000000..f6ac96e9286
--- /dev/null
+++ b/ACE/examples/APG/Reactor/ClientService.h
@@ -0,0 +1,40 @@
+/**
+ * $Id$
+ *
+ * Sample code from The ACE Programmer's Guide,
+ * copyright 2003 Addison-Wesley. All Rights Reserved.
+ */
+
+#ifndef __CLIENTSERVICE_H_
+#define __CLIENTSERVICE_H_
+
+#include "ace/Synch_Traits.h"
+#include "ace/Null_Condition.h"
+#include "ace/Null_Mutex.h"
+
+// Listing 3 code/ch07
+#include "ace/Message_Block.h"
+#include "ace/SOCK_Stream.h"
+#include "ace/Svc_Handler.h"
+
+class ClientService :
+ public ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_NULL_SYNCH>
+{
+ typedef ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_NULL_SYNCH> super;
+
+public:
+ int open (void * = 0);
+
+ // Called when input is available from the client.
+ virtual int handle_input (ACE_HANDLE fd = ACE_INVALID_HANDLE);
+
+ // Called when output is possible.
+ virtual int handle_output (ACE_HANDLE fd = ACE_INVALID_HANDLE);
+
+ // Called when this handler is removed from the ACE_Reactor.
+ virtual int handle_close (ACE_HANDLE handle,
+ ACE_Reactor_Mask close_mask);
+};
+// Listing 3
+
+#endif /* __CLIENTSERVICE_H_ */