-/*] Copyright (c) 2009-2010, Charles McGarvey [**************************
+/*] Copyright (c) 2009-2011, Charles McGarvey [*****************************
**] All rights reserved.
*
-* vi:ts=4 sw=4 tw=75
-*
* Distributable under the terms and conditions of the 2-clause BSD license;
* see the file COPYING for a complete text of the license.
*
-**************************************************************************/
+*****************************************************************************/
#ifndef _MOOF_SERVICE_HH_
#define _MOOF_SERVICE_HH_
-/**
- * \file service.hh
- * Classes for publishing and finding network services.
- */
-
#include <map>
#include <moof/math.hh>
#include <moof/socket.hh>
+/**
+ * \file service.hh
+ * Classes for publishing and finding network services.
+ */
+
namespace moof {
const std::string& name,
const std::string& text);
-
/**
* Publish the service on the network.
*/
*/
void stop();
-
/**
* Get the host address.
* \return The address.
return text_;
}
-
~service();
-
private:
int handle_packet(socket_multiplexer& mux,
- packet& packet,
- const socket::address& address);
+ packet& packet, const socket::address& address);
socket::address address_;
- std::string type_;
- std::string name_;
- std::string text_;
+ std::string type_;
+ std::string name_;
+ std::string text_;
};
* \param sockType The type of socket.
*/
explicit service_finder(const std::string& type,
- int sockType = SOCK_STREAM);
-
+ int sockType = SOCK_STREAM);
const std::map<std::string,service>& services() const
{
return services_;
}
-
private:
int handle_packet(socket_multiplexer& mux,
- packet& packet,
- const socket::address& address);
+ packet& packet, const socket::address& address);
- std::string type_;
+ std::string type_;
std::map<std::string,service> services_;
};