X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2FMoof%2FService.hh;fp=src%2FMoof%2FService.hh;h=77cee183f9b3346c8563dbafff75105b00e9ee76;hp=7c5e6b7b7b440ad4ba9f14fb6ec519eb230633c6;hb=3fd6f206f0e64122b7cb289907a1a780b6ed2dc9;hpb=2a97ae825077e5b75aee35b1c1ada221a4ae7b26 diff --git a/src/Moof/Service.hh b/src/Moof/Service.hh index 7c5e6b7..77cee18 100644 --- a/src/Moof/Service.hh +++ b/src/Moof/Service.hh @@ -9,6 +9,11 @@ * **************************************************************************/ +/** + * \file Service.hh + * Classes for publishing and finding network services. + */ + #ifndef _MOOF_SERVICE_HH_ #define _MOOF_SERVICE_HH_ @@ -36,29 +41,39 @@ public: 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; }; @@ -70,8 +85,6 @@ public: ServiceFinder(const std::string& service, int type = SOCK_STREAM); - void update(Scalar t, Scalar dt); - const std::vector& services() const { @@ -81,7 +94,12 @@ public: private: - std::vector mServices; + int handlePacket(SocketMultiplexer& sock, + Packet& packet, + const SocketAddress& address); + + std::string mService; + std::vector mServices; };