]> git.ipfire.org Git - thirdparty/squid.git/blame - src/comm/UdpOpenDialer.h
SourceFormat Enforcement
[thirdparty/squid.git] / src / comm / UdpOpenDialer.h
CommitLineData
bbc27441 1/*
bde978a6 2 * Copyright (C) 1996-2015 The Squid Software Foundation and contributors
bbc27441
AJ
3 *
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
7 */
8
09cee743
AJ
9#ifndef SQUID_COMM_UDPOPENDIALER_H
10#define SQUID_COMM_UDPOPENDIALER_H
11
12#include "ipc/StartListening.h"
13
14namespace Comm
15{
16
17/// dials a UDP port-opened call
18class UdpOpenDialer: public CallDialer,
f53969cc 19 public Ipc::StartListeningCb
09cee743
AJ
20{
21public:
5b97d3f9 22 typedef void (*Handler)(const Comm::ConnectionPointer &conn, int errNo);
09cee743
AJ
23 UdpOpenDialer(Handler aHandler): handler(aHandler) {}
24
25 virtual void print(std::ostream &os) const { startPrint(os) << ')'; }
26 virtual bool canDial(AsyncCall &) const { return true; }
27 virtual void dial(AsyncCall &) { (handler)(conn, errNo); }
28
29public:
30 Handler handler;
31};
32
33} // namespace Comm
34
35#endif /* SQUID_COMM_UDPOPENDIALER_H */
f53969cc 36