moved peer info fetch into UnixIOSocket; cleaned up interfaces
[libasyncio] / asyncio / async_socket.hpp
index 0849689..3121f70 100644 (file)
@@ -20,13 +20,15 @@ on this file might be covered by the GNU General Public License.
 /** @file
  * @brief socket classes for the AsyncIo framework.
  *
- * (c) Copyright 2008 by Intra2net AG
+ *  @copyright Copyright 2008-2009 by Intra2net AG
+ *  @contact Intra2net Opensource Team \<opensource@intra2net.com\>
  */
 
-#ifndef __SIMPLEIO__SIMPLESOCKET_HPP__
-#define __SIMPLEIO__SIMPLESOCKET_HPP__
+#ifndef __ASYNC_SOCKET_HPP__
+#define __ASYNC_SOCKET_HPP__
 
 #include "async_io.hpp"
+#include "asyncio_system_tools.hpp"
 
 #include <string>
 #include <boost/any.hpp>
@@ -91,7 +93,7 @@ class UnixServerSocket;
 
 
 /**
- * @brief spezialized IO class for unix domain sockets.
+ * @brief specialized IO class for unix domain sockets.
  *
  */
 class UnixIOSocket
@@ -107,9 +109,9 @@ class UnixIOSocket
       friend class UnixServerSocketBase;
       friend class UnixServerSocket<UnixIOSocket>;
 
-      UnixIOSocket(
-         int fd, const std::string& path,
-         unsigned int peer_pid, unsigned int peer_uid, unsigned int peer_gid);
+      UnixIOSocket(int fd, const std::string& path);
+
+      bool update_peer_information(int fd);
 
    protected:
 
@@ -125,7 +127,7 @@ typedef boost::shared_ptr< UnixIOSocket > UnixIOSocketPtr;
 
 
 /**
- * @brief spezialized server socket class for unix domain sockets.
+ * @brief specialized server socket class for unix domain sockets.
  *
  */
 class UnixServerSocketBase
@@ -141,10 +143,7 @@ class UnixServerSocketBase
 
       virtual IOImplementationPtr acceptNewConnection(int fd, boost::any addr);
 
-      virtual UnixIOSocketPtr createIOSocket(
-         int fd, const std::string& path,
-         unsigned int peer_pid,
-         unsigned int peer_uid, unsigned int peer_gid);
+      virtual UnixIOSocketPtr createIOSocket(int fd, const std::string& path);
 
    protected:
 
@@ -156,7 +155,7 @@ class UnixServerSocketBase
 /**
  * @brief unix server socket class which "produces" connections of a determined type.
  *
- + @param IOClass the type of the connections.
+ * @param IOClass the type of the connections.
  */
 template<
    class IOClass
@@ -205,12 +204,10 @@ class UnixServerSocket
    protected:
 
       virtual UnixIOSocketPtr createIOSocket(
-         int fd, const std::string& path,
-         unsigned int peer_pid,
-         unsigned int peer_uid, unsigned int peer_gid)
+         int fd, const std::string& path)
       {
          return UnixIOSocketPtr(
-            new IOClass(fd, path, peer_pid, peer_uid, peer_gid)
+            new IOClass(fd, path)
          );
       }
 
@@ -222,7 +219,8 @@ class UnixServerSocket
 }; // eo class UnixServerSocket
 
 
-}// eo namespace AsyncIo
+
+}// end of namespace AsyncIo
 
 
 #endif