]> Dogcows Code - chaz/yoink/blobdiff - src/Moof/Service.hh
exception-aware packets; other misc socket changes
[chaz/yoink] / src / Moof / Service.hh
index 7c5e6b7b7b440ad4ba9f14fb6ec519eb230633c6..77cee183f9b3346c8563dbafff75105b00e9ee76 100644 (file)
@@ -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<Service>& services() const
        {
@@ -81,7 +94,12 @@ public:
 
 private:
 
-       std::vector<Service> mServices;
+       int handlePacket(SocketMultiplexer& sock,
+                                        Packet& packet,
+                                        const SocketAddress& address);
+
+       std::string                             mService;
+       std::vector<Service>    mServices;
 };
 
 
This page took 0.018163 seconds and 4 git commands to generate.