]>
Commit | Line | Data |
---|---|---|
10cefb7b | 1 | /* |
bbc27441 | 2 | * Copyright (C) 1996-2014 The Squid Software Foundation and contributors |
10cefb7b | 3 | * |
bbc27441 AJ |
4 | * Squid software is distributed under GPLv2+ license and includes |
5 | * contributions from numerous individuals and organizations. | |
6 | * Please see the COPYING and CONTRIBUTORS files for details. | |
10cefb7b | 7 | */ |
8 | ||
bbc27441 AJ |
9 | /* DEBUG: section 54 Interprocess Communication */ |
10 | ||
10cefb7b | 11 | #ifndef SQUID_IPC_STRAND_H |
12 | #define SQUID_IPC_STRAND_H | |
13 | ||
254912f3 | 14 | #include "ipc/forward.h" |
10cefb7b | 15 | #include "ipc/Port.h" |
8822ebee | 16 | #include "mgr/forward.h" |
f738d783 | 17 | #if SQUID_SNMP |
d6e3ad20 | 18 | #include "snmp/forward.h" |
f738d783 | 19 | #endif |
10cefb7b | 20 | |
21 | namespace Ipc | |
22 | { | |
23 | ||
1bac0258 | 24 | class StrandCoord; |
10cefb7b | 25 | |
ba568924 AR |
26 | /// Receives coordination messages on behalf of its process or thread |
27 | class Strand: public Port | |
10cefb7b | 28 | { |
10cefb7b | 29 | public: |
30 | Strand(); | |
31 | ||
ba568924 AR |
32 | virtual void start(); // Port (AsyncJob) API |
33 | ||
34 | protected: | |
35 | virtual void timedout(); // Port (UsdOp) API | |
1bac0258 | 36 | virtual void receive(const TypedMsgHdr &message); // Port API |
10cefb7b | 37 | |
38 | private: | |
ba568924 | 39 | void registerSelf(); /// let Coordinator know this strand exists |
254912f3 | 40 | void handleRegistrationResponse(const HereIamMessage &msg); |
8822ebee AR |
41 | void handleCacheMgrRequest(const Mgr::Request& request); |
42 | void handleCacheMgrResponse(const Mgr::Response& response); | |
f738d783 | 43 | #if SQUID_SNMP |
51ea0904 CT |
44 | void handleSnmpRequest(const Snmp::Request& request); |
45 | void handleSnmpResponse(const Snmp::Response& response); | |
f738d783 | 46 | #endif |
10cefb7b | 47 | |
48 | private: | |
ba568924 | 49 | bool isRegistered; ///< whether Coordinator ACKed registration (unused) |
10cefb7b | 50 | |
ba568924 AR |
51 | private: |
52 | Strand(const Strand&); // not implemented | |
53 | Strand& operator =(const Strand&); // not implemented | |
4ea256cd AR |
54 | |
55 | CBDATA_CLASS2(Strand); | |
10cefb7b | 56 | }; |
57 | ||
10cefb7b | 58 | } |
59 | ||
10cefb7b | 60 | #endif /* SQUID_IPC_STRAND_H */ |