4 // Fraunhofer Institute for Open Communication Systems (FOKUS)
5 // Competence Center NETwork research (NET), St. Augustin, GERMANY
6 // Stefan Bund <g0dil@berlios.de>
8 // This program is free software; you can redistribute it and/or modify
9 // it under the terms of the GNU General Public License as published by
10 // the Free Software Foundation; either version 2 of the License, or
11 // (at your option) any later version.
13 // This program is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 // GNU General Public License for more details.
18 // You should have received a copy of the GNU General Public License
19 // along with this program; if not, write to the
20 // Free Software Foundation, Inc.,
21 // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 \brief UDPServer public header */
26 #ifndef HH_SENF_Utils_Console_UDPServer_
27 #define HH_SENF_Utils_Console_UDPServer_ 1
30 #include <boost/utility.hpp>
31 #include "../../Socket/Protocols/INet/UDPSocketHandle.hh"
32 #include "../Logger/SenfLog.hh"
33 #include "../../Scheduler/Scheduler.hh"
35 #include "Executor.hh"
37 //#include "UDPServer.mpp"
38 ///////////////////////////////hh.p////////////////////////////////////////
46 : public boost::noncopyable
48 SENF_LOG_CLASS_AREA();
49 SENF_LOG_DEFAULT_LEVEL(senf::log::NOTICE);
51 ///////////////////////////////////////////////////////////////////////////
54 typedef senf::ClientSocketHandle<
55 senf::MakeSocketPolicy<senf::UDPv4SocketProtocol::Policy,
56 senf::BSDAddressingPolicy>::policy > Handle;
58 ///////////////////////////////////////////////////////////////////////////
59 ///\name Structors and default members
62 explicit UDPServer(senf::INet4SocketAddress const & address);
63 explicit UDPServer(senf::INet6SocketAddress const & address);
66 ///////////////////////////////////////////////////////////////////////////
68 UDPServer & replies(bool enable);
69 UDPServer & replies(senf::INet4SocketAddress const & address);
70 UDPServer & replies(senf::INet6SocketAddress const & address);
72 DirectoryNode & root() const; ///< Get root node
74 UDPServer & root(DirectoryNode & root); ///< Set root node
75 /**< \a node will be the root node for all clients launched
81 void handleInput(int events);
84 senf::GenericBSDSocketAddress target_;
87 senf::scheduler::FdEvent readevent_;
88 CommandParser parser_;
95 ///////////////////////////////hh.e////////////////////////////////////////
96 //#include "UDPServer.cci"
97 //#include "UDPServer.ct"
98 //#include "UDPServer.cti"
105 // comment-column: 40
106 // c-file-style: "senf"
107 // indent-tabs-mode: nil
108 // ispell-local-dictionary: "american"
109 // compile-command: "scons -u test"