UdpOpenDialer.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1996-2017 The Squid Software Foundation and contributors
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 
9 #ifndef SQUID_COMM_UDPOPENDIALER_H
10 #define SQUID_COMM_UDPOPENDIALER_H
11 
12 #include "ipc/StartListening.h"
13 
14 namespace Comm
15 {
16 
18 class UdpOpenDialer: public CallDialer,
20 {
21 public:
22  typedef void (*Handler)(const Comm::ConnectionPointer &conn, int errNo);
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 
29 public:
31 };
32 
33 } // namespace Comm
34 
35 #endif /* SQUID_COMM_UDPOPENDIALER_H */
36 
std::ostream & startPrint(std::ostream &os) const
starts printing arguments, return os
common API for all StartListening() callbacks
virtual void dial(AsyncCall &)
Definition: UdpOpenDialer.h:27
Comm::ConnectionPointer conn
opened listening socket
virtual bool canDial(AsyncCall &) const
Definition: UdpOpenDialer.h:26
virtual void print(std::ostream &os) const
Definition: UdpOpenDialer.h:25
UdpOpenDialer(Handler aHandler)
Definition: UdpOpenDialer.h:23
int errNo
errno value from the comm_open_listener() call
dials a UDP port-opened call
Definition: UdpOpenDialer.h:18
void(* Handler)(const Comm::ConnectionPointer &conn, int errNo)
Definition: UdpOpenDialer.h:22

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors