]> Dogcows Code - chaz/yoink/blobdiff - src/moof/service.cc
the massive refactoring effort
[chaz/yoink] / src / moof / service.cc
similarity index 60%
rename from src/Moof/Service.cc
rename to src/moof/service.cc
index da135c1fea51513a2f7a4f3af2ebf8c02ab46293..869b541344f4e9e79b6b36a3a8b1499a6a06af31 100644 (file)
@@ -9,20 +9,20 @@
 *
 **************************************************************************/
 
-#include "Service.hh"
-#include "Socket.hh"
+#include "service.hh"
+#include "socket.hh"
 
 
 #define SOLICIT  0x1234ABCD
 #define RESPONSE 0xABCD1234
 
 
-namespace Mf {
+namespace moof {
 
 
-int Service::handlePacket(SocketMultiplexer& mux,
-                                                 Packet& packet,
-                                                 const SocketAddress& address)
+int service::handle_packet(socket_multiplexer& mux,
+                                                  packet& packet,
+                                                  const socket::address& address)
 {
        try
        {
@@ -32,10 +32,10 @@ int Service::handlePacket(SocketMultiplexer& mux,
                {
                        std::string type;
                        packet >> type;
-                       if (type == mType)
+                       if (type == type_)
                        {
                                packet.clear();
-                               packet << RESPONSE << mType << mName << mText;
+                               packet << RESPONSE << type_ << name_ << text_;
                                mux.socket().write(packet);
                                return 0;
                        }
@@ -45,9 +45,9 @@ int Service::handlePacket(SocketMultiplexer& mux,
        return -1;
 }
 
-int ServiceFinder::handlePacket(SocketMultiplexer& mux,
-                                                               Packet& packet,
-                                                               const SocketAddress& address)
+int service_finder::handle_packet(socket_multiplexer& mux,
+                                                                 packet& packet,
+                                                                 const socket::address& address)
 {
        try
        {
@@ -57,13 +57,13 @@ int ServiceFinder::handlePacket(SocketMultiplexer& mux,
                {
                        std::string type;
                        packet >> type;
-                       if (type == mType)
+                       if (type == type_)
                        {
                                std::string name;
                                std::string     text;
                                packet >> name >> text;
-                               Service service(address, type, name, text);
-                               mServices.insert(std::make_pair(name, service));
+                               service service(address, type, name, text);
+                               services_.insert(std::make_pair(name, service));
                                return 0;
                        }
                }
@@ -72,10 +72,10 @@ int ServiceFinder::handlePacket(SocketMultiplexer& mux,
        return -1;
 }
 
-ServiceFinder::ServiceFinder(const std::string& type, int sockType)
+service_finder::service_finder(const std::string& type, int sockType)
 {
 }
 
 
-} // namespace Mf
+} // namespace moof
 
This page took 0.022634 seconds and 4 git commands to generate.