Use =default for skeleton copy constructor
[ACE_TAO.git] / ACE / examples / C++NPv2 / Logging_Acceptor.cpp
blob346641f5547da2673e56d5e940e96d65b156b17a
1 /*
2 ** Copyright 2002 Addison Wesley. All Rights Reserved.
3 */
5 #include "Logging_Acceptor.h"
6 #include "Logging_Event_Handler.h"
9 int Logging_Acceptor::open (const ACE_INET_Addr &local_addr) {
10 if (acceptor_.open (local_addr) == -1) return -1;
11 return reactor ()->register_handler
12 (this, ACE_Event_Handler::ACCEPT_MASK);
15 int Logging_Acceptor::handle_input (ACE_HANDLE) {
16 Logging_Event_Handler *peer_handler = 0;
17 ACE_NEW_RETURN (peer_handler,
18 Logging_Event_Handler (reactor ()),
19 -1);
21 if (acceptor_.accept (peer_handler->peer ()) == -1) {
22 delete peer_handler;
23 return -1;
24 } else if (peer_handler->open () == -1) {
25 peer_handler->handle_close ();
26 return -1;
28 return 0;
31 int Logging_Acceptor::handle_close (ACE_HANDLE,
32 ACE_Reactor_Mask) {
33 acceptor_.close ();
34 delete this;
35 return 0;