1 // Copyright Leandro Lucarella 2008 - 2010.
2 // Distributed under the Boost Software License, Version 1.0.
3 // (See accompanying file COPYING or copy at
4 // http://www.boost.org/LICENSE_1_0.txt)
7 #ifndef TEST_SOCKET_IP_COMMON_HPP_
8 #define TEST_SOCKET_IP_COMMON_HPP_
10 #include <posixx/socket/inet.hpp> // posixx::socket::inet
11 #include <posixx/socket/inet/print.hpp> // address ostream formatting
12 #include <posixx/socket/opt.hpp> // posixx::socket::opt::REUSEADDR
13 #include <ostream> // std::ostream
15 #define IP "127.0.0.1"
20 void clean_test_address(posixx::socket::inet::socket& socket,
21 const posixx::socket::inet::sockaddr& addr)
23 // reuse the socket address (just in case)
24 socket.opt< posixx::socket::opt::REUSEADDR >(true);
27 static posixx::socket::inet::sockaddr test_address1(IP, PORT1);
28 static posixx::socket::inet::sockaddr test_address2(IP, PORT2);
30 #endif // TEST_SOCKET_IP_COMMON_HPP_