Add 'include/senf' directory
[senf.git] / Examples / TCPClientServer / server.cc
index 99991f7..0504948 100644 (file)
@@ -3,6 +3,7 @@
 // Copyright (C) 2007
 // Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS)
 // Kompetenzzentrum fuer Satelitenkommunikation (SatCom)
+//     Thorsten Horstmann <thorsten.horstmann@fokus.fraunhofer.de>
 //
 // This program is free software; you can redistribute it and/or modify
 // it under the terms of the GNU General Public License as published by
 
 // Custom includes
 #include <string>
-#include "Scheduler/Scheduler.hh"
-#include "Utils/membind.hh"
-#include "Socket/TCPSocketHandle.hh"
-#include "Socket/INetAddressing.hh"
-#include "Packets/EthernetPacket.hh"
-
+#include <iostream>
+#include <senf/Scheduler/Scheduler.hh>
+#include <senf/Utils/membind.hh>
+#include <senf/Socket/Protocols/INet.hh>
 
 class Server
 {
     senf::TCPv4ServerSocketHandle serverSock;
 
 public:
-    Server(std::string const & host, unsigned int port)
-        : serverSock(senf::INet4Address(host, port)) {}
+    Server(senf::INet4Address const & host, unsigned int port)
+        : serverSock(senf::INet4SocketAddress(host, port)) {}
     
     void run() 
     {
@@ -75,7 +74,7 @@ private:
 int main(int argc, char const * argv[])
 {
     try {
-        Server myServer ("127.0.0.1", 4243);
+        Server myServer (senf::INet4Address::Loopback, 4243);
         myServer.run();
     }
     catch (std::exception const & ex) {
@@ -83,3 +82,14 @@ int main(int argc, char const * argv[])
     }
     return 0;
 }
+
+\f
+// Local Variables:
+// mode: c++
+// fill-column: 100
+// c-file-style: "senf"
+// indent-tabs-mode: nil
+// ispell-local-dictionary: "american"
+// compile-command: "scons -u"
+// comment-column: 40
+// End: