]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/ipc/Port.cc
4 * DEBUG: section 54 Interprocess Communication
11 #include "CommCalls.h"
12 #include "comm/Connection.h"
15 const char Ipc::coordinatorAddr
[] = DEFAULT_STATEDIR
"/coordinator.ipc";
16 const char Ipc::strandAddrPfx
[] = DEFAULT_STATEDIR
"/kid";
19 Ipc::Port::Port(const String
& aListenAddr
):
22 setOptions(COMM_NONBLOCKING
| COMM_DOBIND
);
25 void Ipc::Port::start()
31 void Ipc::Port::listen()
35 typedef CommCbMemFunT
<Port
, CommIoCbParams
> Dialer
;
36 AsyncCall::Pointer readHandler
= JobCallback(54, 6,
37 Dialer
, this, Port::noteRead
);
38 comm_read(conn(), buf
.raw(), buf
.size(), readHandler
);
41 bool Ipc::Port::doneAll() const
43 return false; // listen forever
46 String
Ipc::Port::MakeAddr(const char* pathAddr
, int id
)
49 String addr
= pathAddr
;
51 addr
.append(xitoa(id
));
56 void Ipc::Port::noteRead(const CommIoCbParams
& params
)
58 debugs(54, 6, HERE
<< params
.conn
<< " flag " << params
.flag
<<
60 if (params
.flag
== COMM_OK
) {
61 assert(params
.buf
== buf
.raw());
64 // TODO: if there was a fatal error on our socket, close the socket before
65 // trying to listen again and print a level-1 error message.