]>
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 typedef CommCbMemFunT
<Port
, CommIoCbParams
> Dialer
;
35 AsyncCall::Pointer readHandler
= JobCallback(54, 6,
36 Dialer
, this, Port::noteRead
);
37 comm_read(conn(), buf
.raw(), buf
.size(), readHandler
);
40 bool Ipc::Port::doneAll() const
42 return false; // listen forever
45 String
Ipc::Port::MakeAddr(const char* pathAddr
, int id
)
48 String addr
= pathAddr
;
50 addr
.append(xitoa(id
));
55 void Ipc::Port::noteRead(const CommIoCbParams
& params
)
57 debugs(54, 6, HERE
<< params
.conn
<< " flag " << params
.flag
<<
59 if (params
.flag
== COMM_OK
) {
60 assert(params
.buf
== buf
.raw());
63 // TODO: if there was a fatal error on our socket, close the socket before
64 // trying to listen again and print a level-1 error message.