3 //=============================================================================
5 * @file Logging_Handler.h
9 //=============================================================================
11 #ifndef _CLIENT_HANDLER_H
12 #define _CLIENT_HANDLER_H
14 #include "ace/Event_Handler.h"
16 #if !defined (ACE_LACKS_PRAGMA_ONCE)
18 #endif /* ACE_LACKS_PRAGMA_ONCE */
20 #include "ace/INET_Addr.h"
21 #include "ace/SOCK_Stream.h"
22 #include "ace/os_include/os_netdb.h"
25 * @class Logging_Handler
27 * @brief Receive client message from the remote clients.
29 * This class demonstrates how to receive messages from remote
30 * clients using the notification mechanisms in the
31 * <ACE_Reactor>. In addition, it also illustrates how to
32 * utilize the <ACE_Reactor> timer mechanisms, as well.
34 class Logging_Handler
: public ACE_Event_Handler
37 Logging_Handler () = default;
39 // = Hooks for opening and closing handlers.
43 /// Conversion operators.
44 ACE_SOCK_Stream
&peer ();
47 // = Demultiplexing hooks.
48 ACE_HANDLE
get_handle () const override
;
49 int handle_input (ACE_HANDLE
) override
;
50 int handle_close (ACE_HANDLE
= ACE_INVALID_HANDLE
,
51 ACE_Reactor_Mask
= ACE_Event_Handler::ALL_EVENTS_MASK
) override
;
52 int handle_timeout (const ACE_Time_Value
&tv
, const void *arg
) override
;
54 // = Really should be private...
55 /// Ensure dynamic allocation.
56 virtual ~Logging_Handler ();
59 /// Host we are connected to.
60 char host_name_
[MAXHOSTNAMELEN
+ 1];
62 /// Connection with client
63 ACE_SOCK_Stream cli_stream_
;
66 #endif /* _CLIENT_HANDLER_H */