Use =default for skeleton copy constructor
[ACE_TAO.git] / ACE / examples / C++NPv2 / Logging_Acceptor_Ex.h
blobda6112d0741d5423746c204173d1de3a59b98d1b
1 /*
2 ** Copyright 2002 Addison Wesley. All Rights Reserved.
3 */
5 #ifndef _LOGGING_ACCEPTOR_EX_H
6 #define _LOGGING_ACCEPTOR_EX_H
8 #include "ace/INET_Addr.h"
9 #include "ace/Reactor.h"
11 #include "Logging_Acceptor.h"
12 #include "Logging_Event_Handler_Ex.h"
14 class Logging_Acceptor_Ex : public Logging_Acceptor
16 public:
17 typedef ACE_INET_Addr PEER_ADDR;
19 // Simple constructor to pass ACE_Reactor to base class.
20 Logging_Acceptor_Ex (ACE_Reactor *r = ACE_Reactor::instance ())
21 : Logging_Acceptor (r) {}
23 int handle_input (ACE_HANDLE) {
24 Logging_Event_Handler_Ex *peer_handler = 0;
25 ACE_NEW_RETURN (peer_handler,
26 Logging_Event_Handler_Ex (reactor ()),
27 -1);
28 if (acceptor_.accept (peer_handler->peer ()) == -1) {
29 delete peer_handler;
30 return -1;
31 } else if (peer_handler->open () == -1) {
32 peer_handler->handle_close ();
33 return -1;
35 return 0;
39 #endif /* _LOGGING_ACCEPTOR_EX_H */