]> git.ipfire.org Git - thirdparty/squid.git/blame - src/ipc/StartListening.h
SourceFormat Enforcement
[thirdparty/squid.git] / src / ipc / StartListening.h
CommitLineData
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/Subscription.h"
12#include "comm/forward.h"
a67d2b2e 13#include "ip/forward.h"
0d0bce6a
AR
14#include "ipc/FdNotes.h"
15#include "base/AsyncCall.h"
16
055421ee
AJ
17#if HAVE_IOSFWD
18#include <iosfwd>
19#endif
20
0d0bce6a
AR
21namespace Ipc
22{
23
24/// common API for all StartListening() callbacks
25class StartListeningCb
26{
27public:
28 StartListeningCb();
29 virtual ~StartListeningCb();
30
31 /// starts printing arguments, return os
32 std::ostream &startPrint(std::ostream &os) const;
33
34public:
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
8bbb16e3 41/// the listening FD or open a listening socket directly.
e0d28505 42extern void StartListening(int sock_type, int proto, const Comm::ConnectionPointer &listenConn,
8bbb16e3 43 FdNoteId fdNote, AsyncCall::Pointer &callback);
0d0bce6a
AR
44
45} // namespace Ipc;
46
0d0bce6a 47#endif /* SQUID_IPC_START_LISTENING_H */