5
// Copyright (c) 2003-2007 Christopher M. Kohlhoff (chris at kohlhoff dot com)
5
// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com)
7
7
// Distributed under the Boost Software License, Version 1.0. (See accompanying
8
8
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
92
92
ip::unicast::hops hops1(1);
93
93
BOOST_CHECK(hops1.value() == 1);
94
94
sock_v4.set_option(hops1, ec);
95
#if defined(BOOST_WINDOWS) && defined(UNDER_CE)
96
// Option is not supported under Windows CE.
97
BOOST_CHECK_MESSAGE(ec == asio::error::no_protocol_option,
98
ec.value() << ", " << ec.message());
99
#else // defined(BOOST_WINDOWS) && defined(UNDER_CE)
101
#endif // defined(BOOST_WINDOWS) && defined(UNDER_CE)
97
103
ip::unicast::hops hops2;
98
104
sock_v4.get_option(hops2, ec);
105
#if defined(BOOST_WINDOWS) && defined(UNDER_CE)
106
// Option is not supported under Windows CE.
107
BOOST_CHECK_MESSAGE(ec == asio::error::no_protocol_option,
108
ec.value() << ", " << ec.message());
109
#else // defined(BOOST_WINDOWS) && defined(UNDER_CE)
100
111
BOOST_CHECK(hops2.value() == 1);
112
#endif // defined(BOOST_WINDOWS) && defined(UNDER_CE)
102
114
ip::unicast::hops hops3(255);
103
115
BOOST_CHECK(hops3.value() == 255);
104
116
sock_v4.set_option(hops3, ec);
117
#if defined(BOOST_WINDOWS) && defined(UNDER_CE)
118
// Option is not supported under Windows CE.
119
BOOST_CHECK_MESSAGE(ec == asio::error::no_protocol_option,
120
ec.value() << ", " << ec.message());
121
#else // defined(BOOST_WINDOWS) && defined(UNDER_CE)
105
122
BOOST_CHECK(!ec);
123
#endif // defined(BOOST_WINDOWS) && defined(UNDER_CE)
107
125
ip::unicast::hops hops4;
108
126
sock_v4.get_option(hops4, ec);
127
#if defined(BOOST_WINDOWS) && defined(UNDER_CE)
128
// Option is not supported under Windows CE.
129
BOOST_CHECK_MESSAGE(ec == asio::error::no_protocol_option,
130
ec.value() << ", " << ec.message());
131
#else // defined(BOOST_WINDOWS) && defined(UNDER_CE)
109
132
BOOST_CHECK(!ec);
110
133
BOOST_CHECK(hops4.value() == 255);
134
#endif // defined(BOOST_WINDOWS) && defined(UNDER_CE)