]> 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 "ip/forward.h"
13 #include "ipc/FdNotes.h"
14 #include "base/AsyncCall.h"
15
16 #if HAVE_IOSFWD
17 #include <iosfwd>
18 #endif
19
20 namespace Ipc
21 {
22
23 /// common API for all StartListening() callbacks
24 class StartListeningCb
25 {
26 public:
27 StartListeningCb();
28 virtual ~StartListeningCb();
29
30 /// starts printing arguments, return os
31 std::ostream &startPrint(std::ostream &os) const;
32
33 public:
34 int fd; ///< opened listening socket or -1
35 int errNo; ///< errno value from the comm_open_listener() call
36 };
37
38 /// Depending on whether SMP is on, either ask Coordinator to send us
39 /// the listening FD or call comm_open_listener() directly.
40 extern void StartListening(int sock_type, int proto, Ip::Address &addr,
41 int flags, FdNoteId fdNote, AsyncCall::Pointer &callback);
42
43 } // namespace Ipc;
44
45
46 #endif /* SQUID_IPC_START_LISTENING_H */