]>
Commit | Line | Data |
---|---|---|
09cee743 AJ |
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: | |
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 | ||
21 | public: | |
22 | Handler handler; | |
23 | }; | |
24 | ||
25 | } // namespace Comm | |
26 | ||
27 | #endif /* SQUID_COMM_UDPOPENDIALER_H */ |