]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/comm/UdpOpenDialer.h
2 * Copyright (C) 1996-2016 The Squid Software Foundation and contributors
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.
9 #ifndef SQUID_COMM_UDPOPENDIALER_H
10 #define SQUID_COMM_UDPOPENDIALER_H
12 #include "ipc/StartListening.h"
17 /// dials a UDP port-opened call
18 class UdpOpenDialer
: public CallDialer
,
19 public Ipc::StartListeningCb
22 typedef void (*Handler
)(const Comm::ConnectionPointer
&conn
, int errNo
);
23 UdpOpenDialer(Handler aHandler
): handler(aHandler
) {}
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
); }
35 #endif /* SQUID_COMM_UDPOPENDIALER_H */