]>
Commit | Line | Data |
---|---|---|
0d0bce6a AR |
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 | ||
e0d28505 AJ |
11 | #include "base/AsyncCall.h" |
12 | #include "base/Subscription.h" | |
13 | #include "comm/forward.h" | |
a67d2b2e | 14 | #include "ip/forward.h" |
0d0bce6a | 15 | #include "ipc/FdNotes.h" |
0d0bce6a | 16 | |
055421ee AJ |
17 | #if HAVE_IOSFWD |
18 | #include <iosfwd> | |
19 | #endif | |
20 | ||
0d0bce6a AR |
21 | namespace Ipc |
22 | { | |
23 | ||
24 | /// common API for all StartListening() callbacks | |
25 | class StartListeningCb | |
26 | { | |
27 | public: | |
28 | StartListeningCb(); | |
29 | virtual ~StartListeningCb(); | |
30 | ||
31 | /// starts printing arguments, return os | |
32 | std::ostream &startPrint(std::ostream &os) const; | |
33 | ||
34 | public: | |
e0d28505 | 35 | Comm::ConnectionPointer conn; ///< opened listening socket |
0d0bce6a | 36 | int errNo; ///< errno value from the comm_open_listener() call |
e0d28505 | 37 | Subscription::Pointer handlerSubscription; ///< The subscription we will pass on to the ConnAcceptor |
0d0bce6a AR |
38 | }; |
39 | ||
40 | /// Depending on whether SMP is on, either ask Coordinator to send us | |
e0d28505 AJ |
41 | /// the listening FD or start a connection acceptor directly. |
42 | extern void StartListening(int sock_type, int proto, const Comm::ConnectionPointer &listenConn, | |
43 | FdNoteId fdNote, AsyncCall::Pointer &callback, const Subscription::Pointer &handlerSub); | |
0d0bce6a AR |
44 | |
45 | } // namespace Ipc; | |
46 | ||
47 | ||
48 | #endif /* SQUID_IPC_START_LISTENING_H */ |