]> git.ipfire.org Git - thirdparty/squid.git/blame - src/comm/UdpOpenDialer.h
Boilerplate: update copyright blurbs on Squid helpers
[thirdparty/squid.git] / src / comm / UdpOpenDialer.h
CommitLineData
09cee743
AJ
1#ifndef SQUID_COMM_UDPOPENDIALER_H
2#define SQUID_COMM_UDPOPENDIALER_H
3
4#include "ipc/StartListening.h"
5
6namespace Comm
7{
8
9/// dials a UDP port-opened call
10class UdpOpenDialer: public CallDialer,
11 public Ipc::StartListeningCb
12{
13public:
5b97d3f9 14 typedef void (*Handler)(const Comm::ConnectionPointer &conn, int errNo);
09cee743
AJ
15 UdpOpenDialer(Handler aHandler): handler(aHandler) {}
16
17 virtual void print(std::ostream &os) const { startPrint(os) << ')'; }
18 virtual bool canDial(AsyncCall &) const { return true; }
19 virtual void dial(AsyncCall &) { (handler)(conn, errNo); }
20
21public:
22 Handler handler;
23};
24
25} // namespace Comm
26
27#endif /* SQUID_COMM_UDPOPENDIALER_H */