*
**************************************************************************/
+/**
+ * \file Service.hh
+ * Classes for publishing and finding network services.
+ */
+
#ifndef _MOOF_SERVICE_HH_
#define _MOOF_SERVICE_HH_
Service(const SocketAddress& address, const std::string& text);
+ /**
+ * Publish the service on the local network.
+ */
+ void publish();
+
+ void stop();
+
+
/**
* Get the host address.
* \return The address.
*/
- const SocketAddress& address() const;
+ const SocketAddress& address() const
+ {
+ return mAddress;
+ }
/**
* Get the service information.
* \return The service information as a string.
*/
- const std::string& text() const;
-
-
- /**
- * Publish the service on the network.
- */
- void publish();
-
- void update(Scalar t, Scalar dt);
+ const std::string& text() const
+ {
+ return mText;
+ }
private:
+ int handlePacket(SocketMultiplexer& sock,
+ Packet& packet,
+ const SocketAddress& address);
+
SocketAddress mAddress;
std::string mText;
};
ServiceFinder(const std::string& service, int type = SOCK_STREAM);
- void update(Scalar t, Scalar dt);
-
const std::vector<Service>& services() const
{
private:
- std::vector<Service> mServices;
+ int handlePacket(SocketMultiplexer& sock,
+ Packet& packet,
+ const SocketAddress& address);
+
+ std::string mService;
+ std::vector<Service> mServices;
};