]> git.llucax.com Git - software/posixx.git/blobdiff - src/socket/inet/print.hpp
Add Boost License
[software/posixx.git] / src / socket / inet / print.hpp
index 7c61e26f8aa84137552c06af38102cbe881d3bc3..dbbfb4ad9c4ce220d14f094307b2c5c6b2e0d6b3 100644 (file)
@@ -1,3 +1,9 @@
+// Copyright Leandro Lucarella 2008 - 2010.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file COPYING or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+
 #ifndef POSIXX_SOCKET_INET_PRINT_HPP_
 #define POSIXX_SOCKET_INET_PRINT_HPP_
 
@@ -8,8 +14,8 @@ inline
 std::ostream& operator << (std::ostream& os,
                const posixx::socket::inet::sockaddr& sa) throw()
 {
-       return os << "inet::sockaddr(port=" << ntohs(sa.sin_port)
-                       << ", addr=" << inet_ntoa(sa.sin_addr) << ")";
+       return os << "inet::sockaddr(addr=" << sa.addr()
+                       << ", port=" << sa.port() << ")";
 }
 
 #endif // POSIXX_SOCKET_INET_PRINT_HPP_