]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/ipc/Port.h
2 * Copyright (C) 1996-2015 The Squid Software Foundation and contributors
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.
9 /* DEBUG: section 54 Interprocess Communication */
11 #ifndef SQUID_IPC_PORT_H
12 #define SQUID_IPC_PORT_H
14 #include "ipc/UdsOp.h"
15 #include "SquidString.h"
20 /// Waits for and receives incoming IPC messages; kids handle the messages
21 class Port
: public UdsOp
24 Port(const String
&aListenAddr
);
25 /// calculates IPC message address for strand #id of processLabel type
26 static String
MakeAddr(const char *proccessLabel
, int id
);
28 /// get the IPC message address for coordinator process
29 static String
CoordinatorAddr();
32 virtual void start() = 0; // UdsOp (AsyncJob) API; has body
33 virtual bool doneAll() const; // UdsOp (AsyncJob) API
35 /// read the next incoming message
38 /// handle IPC message just read
39 virtual void receive(const TypedMsgHdr
& message
) = 0;
42 void noteRead(const CommIoCbParams
¶ms
); // Comm callback API
45 TypedMsgHdr buf
; ///< msghdr struct filled by Comm
48 extern const char strandAddrLabel
[]; ///< strand's listening address unique label
52 #endif /* SQUID_IPC_PORT_H */