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