/*
- * $Id$
- *
* DEBUG: section 54 Interprocess Communication
*
*/
-#include "config.h"
+#include "squid.h"
#include "comm.h"
-#include "CommCalls.h"
#include "comm/Connection.h"
+#include "CommCalls.h"
#include "ipc/Port.h"
-const char Ipc::coordinatorAddr[] = DEFAULT_PREFIX "/var/run/coordinator.ipc";
-const char Ipc::strandAddrPfx[] = DEFAULT_PREFIX "/var/run/squid";
-
+const char Ipc::coordinatorAddr[] = DEFAULT_STATEDIR "/coordinator.ipc";
+const char Ipc::strandAddrPfx[] = DEFAULT_STATEDIR "/kid";
Ipc::Port::Port(const String& aListenAddr):
UdsOp(aListenAddr)
void Ipc::Port::start()
{
UdsOp::start();
- listen();
+ doListen();
}
-void Ipc::Port::listen()
+void Ipc::Port::doListen()
{
debugs(54, 6, HERE);
buf.prepForReading();
typedef CommCbMemFunT<Port, CommIoCbParams> Dialer;
AsyncCall::Pointer readHandler = JobCallback(54, 6,
Dialer, this, Port::noteRead);
- comm_read(fd(), buf.raw(), buf.size(), readHandler);
+ comm_read(conn(), buf.raw(), buf.size(), readHandler);
}
bool Ipc::Port::doneAll() const
void Ipc::Port::noteRead(const CommIoCbParams& params)
{
- debugs(54, 6, HERE << "FD " << params.fd << " flag " << params.flag <<
+ debugs(54, 6, HERE << params.conn << " flag " << params.flag <<
" [" << this << ']');
if (params.flag == COMM_OK) {
assert(params.buf == buf.raw());
// TODO: if there was a fatal error on our socket, close the socket before
// trying to listen again and print a level-1 error message.
- listen();
+ doListen();
}