]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/ipc/Port.cc
4 * DEBUG: section 54 Interprocess Communication
10 #include "CommCalls.h"
11 #include "comm/Connection.h"
14 const char Ipc::coordinatorAddr
[] = DEFAULT_PREFIX
"/var/run/coordinator.ipc";
15 const char Ipc::strandAddrPfx
[] = DEFAULT_PREFIX
"/var/run/squid";
18 Ipc::Port::Port(const String
& aListenAddr
):
21 setOptions(COMM_NONBLOCKING
| COMM_DOBIND
);
24 void Ipc::Port::start()
30 void Ipc::Port::listen()
34 AsyncCall::Pointer readHandler
= asyncCall(54, 6, "Ipc::Port::noteRead",
35 CommCbMemFunT
<Port
, CommIoCbParams
>(this, &Port::noteRead
));
36 comm_read(fd(), buf
.raw(), buf
.size(), readHandler
);
39 bool Ipc::Port::doneAll() const
41 return false; // listen forever
44 String
Ipc::Port::MakeAddr(const char* pathAddr
, int id
)
47 String addr
= pathAddr
;
49 addr
.append(xitoa(id
));
54 void Ipc::Port::noteRead(const CommIoCbParams
& params
)
56 debugs(54, 6, HERE
<< "FD " << params
.fd
<< " flag " << params
.flag
<<
58 if (params
.flag
== COMM_OK
) {
59 assert(params
.buf
== buf
.raw());
62 // TODO: if there was a fatal error on our socket, close the socket before
63 // trying to listen again and print a level-1 error message.