Free Electron
Listener.h
Go to the documentation of this file.
1 /* Copyright (C) 2003-2021 Free Electron Organization
2  Any use of this software requires a license. If a valid license
3  was not distributed with this file, visit freeelectron.org. */
4 
5 /** @file */
6 
7 #ifndef __netsignal_Listener_h__
8 #define __netsignal_Listener_h__
9 namespace fe
10 {
11 namespace ext
12 {
13 
14 typedef Spool<Socket> SocketSpool;
15 
16 class ListenerTask: public Thread::Functor
17 {
18  public:
19  ListenerTask(void);
20 virtual void operate(void);
21 
22  sp<SocketSpool> m_spSocketSpool;
23  sp<Socket> m_spSocket;
24 };
25 
26 class Listener : public Component
27 {
28  public:
29  Listener(void);
30 virtual ~Listener(void);
31 
32 virtual void start(sp<SocketSpool> spSocketSpool, sp<Socket> spSocket,
33  String ioPriority);
34 virtual void stop(void);
35 
36  private:
37  Thread* m_pListenerThread;
38  ListenerTask m_listenerTask;
39  bool m_operating;
40  Poison m_poison;
41 };
42 
43 } /* namespace ext */
44 } /* namespace fe */
45 
46 #endif /* __netsignal_Listener_h__ */
47 
kernel
Definition: namespace.dox:3