summaryrefslogtreecommitdiff
path: root/examples/Logger/simple-server/Logging_Acceptor.h
blob: 0424a7c3889cbe552b884ddb5221559cc420514b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/* -*- C++ -*- */
// $Id$

// ============================================================================
//
// = LIBRARY
//    examples
//
// = FILENAME
//    Logging_Acceptor.h
//
// = AUTHOR
//    Doug Schmidt
//
// ============================================================================

#ifndef _CLIENT_ACCEPTOR_H
#define _CLIENT_ACCEPTOR_H

#include "ace/SOCK_Acceptor.h"

#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */

#include "ace/Event_Handler.h"

class Logging_Acceptor : public ACE_Event_Handler
  // = TITLE
  //     Handle connection requests from remote client clients.
  //
  // = DESCRIPTION
  //     Accepts client connection requests, creates Logging_Handler's
  //     to process them, and registers these Handlers with the
  //     ACE_Reactor Singleton.
{
friend class Logging_Handler;
public:
  Logging_Acceptor (void);
  // Constructor.

  int open (const ACE_INET_Addr &a);
  // Initialization.

private:
  // = Demuxing hooks.
  virtual int handle_input (ACE_HANDLE);
  virtual int handle_close (ACE_HANDLE, ACE_Reactor_Mask);
  virtual ACE_HANDLE get_handle (void) const;

  ~Logging_Acceptor (void);
  // By making this private we ensure that the <Logging_Acceptor> is
  // allocated dynamically.

  ACE_SOCK_Acceptor peer_acceptor_;
  // Passive connection acceptor factory.
};

#endif /* _CLIENT_ACCEPTOR_H */