]> git.ipfire.org Git - thirdparty/squid.git/blob - src/ipc/StartListening.h
Merge from trunk
[thirdparty/squid.git] / src / ipc / StartListening.h
1 /*
2 * $Id$
3 *
4 * DEBUG: section 54 Interprocess Communication
5 *
6 */
7
8 #ifndef SQUID_IPC_START_LISTENING_H
9 #define SQUID_IPC_START_LISTENING_H
10
11 #include "config.h"
12 #include "base/AsyncCall.h"
13 #include "base/Subscription.h"
14 #include "comm/forward.h"
15 #include "ip/forward.h"
16 #include "ipc/FdNotes.h"
17
18 #if HAVE_IOSFWD
19 #include <iosfwd>
20 #endif
21
22 namespace Ipc
23 {
24
25 /// common API for all StartListening() callbacks
26 class StartListeningCb
27 {
28 public:
29 StartListeningCb();
30 virtual ~StartListeningCb();
31
32 /// starts printing arguments, return os
33 std::ostream &startPrint(std::ostream &os) const;
34
35 public:
36 Comm::ConnectionPointer conn; ///< opened listening socket
37 int errNo; ///< errno value from the comm_open_listener() call
38 Subscription::Pointer handlerSubscription; ///< The subscription we will pass on to the ConnAcceptor
39 };
40
41 /// Depending on whether SMP is on, either ask Coordinator to send us
42 /// the listening FD or start a connection acceptor directly.
43 extern void StartListening(int sock_type, int proto, const Comm::ConnectionPointer &listenConn,
44 FdNoteId fdNote, AsyncCall::Pointer &callback, const Subscription::Pointer &handlerSub);
45
46 } // namespace Ipc;
47
48
49 #endif /* SQUID_IPC_START_LISTENING_H */