MCPcopy Create free account
hub / github.com/boostorg/asio / test_connect_range

Function test_connect_range

test/connect.cpp:129–161  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

127}
128
129void test_connect_range()
130{
131 connection_sink sink;
132 boost::asio::io_context io_context;
133 boost::asio::ip::tcp::socket socket(io_context);
134 std::vector<boost::asio::ip::tcp::endpoint> endpoints;
135 boost::asio::ip::tcp::endpoint result;
136
137 try
138 {
139 result = boost::asio::connect(socket, endpoints);
140 BOOST_ASIO_CHECK(false);
141 }
142 catch (boost::system::system_error& e)
143 {
144 BOOST_ASIO_CHECK(e.code() == boost::asio::error::not_found);
145 }
146
147 endpoints.push_back(sink.target_endpoint());
148
149 result = boost::asio::connect(socket, endpoints);
150 BOOST_ASIO_CHECK(result == endpoints[0]);
151
152 endpoints.push_back(sink.target_endpoint());
153
154 result = boost::asio::connect(socket, endpoints);
155 BOOST_ASIO_CHECK(result == endpoints[0]);
156
157 endpoints.insert(endpoints.begin(), boost::asio::ip::tcp::endpoint());
158
159 result = boost::asio::connect(socket, endpoints);
160 BOOST_ASIO_CHECK(result == endpoints[1]);
161}
162
163void test_connect_range_ec()
164{

Callers

nothing calls this directly

Calls 6

codeMethod · 0.80
target_endpointMethod · 0.80
insertMethod · 0.80
connectFunction · 0.50
endpointClass · 0.50
beginMethod · 0.45

Tested by

no test coverage detected