+/*
+ * Copyright (C) 1996-2015 The Squid Software Foundation and contributors
+ *
+ * Squid software is distributed under GPLv2+ license and includes
+ * contributions from numerous individuals and organizations.
+ * Please see the COPYING and CONTRIBUTORS files for details.
+ */
+
#ifndef SQUID_COMM_TCPACCEPTOR_H
#define SQUID_COMM_TCPACCEPTOR_H
+#include "anyp/forward.h"
#include "base/AsyncJob.h"
#include "base/CbcPointer.h"
#include "base/Subscription.h"
*/
class TcpAcceptor : public AsyncJob
{
+ CBDATA_CLASS(TcpAcceptor);
+
public:
typedef CbcPointer<Comm::TcpAcceptor> Pointer;
public:
TcpAcceptor(const Comm::ConnectionPointer &conn, const char *note, const Subscription::Pointer &aSub);
+ TcpAcceptor(const AnyP::PortCfgPointer &listenPort, const char *note, const Subscription::Pointer &aSub);
/** Subscribe a handler to receive calls back about new connections.
* Unsubscribes any existing subscribed handler.
/// Reserved for read-only use.
ConnectionPointer conn;
+ /// configuration details of the listening port (if provided)
+ AnyP::PortCfgPointer listenPort_;
+
/// listen socket closure handler
AsyncCall::Pointer closer_;
Comm::Flag oldAccept(Comm::ConnectionPointer &details);
void setListen();
void handleClosure(const CommCloseCbParams &io);
-
- CBDATA_CLASS2(TcpAcceptor);
};
} // namespace Comm
#endif /* SQUID_COMM_TCPACCEPTOR_H */
+