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