]> git.ipfire.org Git - thirdparty/squid.git/blob - src/comm/UdpOpenDialer.h
Merged from trunk (r12132, v3.2.0.17+)
[thirdparty/squid.git] / src / comm / UdpOpenDialer.h
1 #ifndef SQUID_COMM_UDPOPENDIALER_H
2 #define SQUID_COMM_UDPOPENDIALER_H
3
4 #include "ipc/StartListening.h"
5
6 namespace Comm
7 {
8
9 /// dials a UDP port-opened call
10 class UdpOpenDialer: public CallDialer,
11 public Ipc::StartListeningCb
12 {
13 public:
14 typedef void (*Handler)(const Comm::ConnectionPointer &conn, int errNo);
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
21 public:
22 Handler handler;
23 };
24
25 } // namespace Comm
26
27 #endif /* SQUID_COMM_UDPOPENDIALER_H */