In order to run this test interface detection is required. Since it is
right now implemented on Linux only it had to be disabled on every other
OS.
}
sock.set_option(asio::socket_base::broadcast(true), err_code);
if (err_code) {
+ sock.close();
isc_throw(Unexpected, "failed to enable broadcast on the socket");
}
}
// Try to connect to remote endpoint and check if attempt is successful.
sock.connect(remote_endpoint->getASIOEndpoint(), err_code);
if (err_code) {
+ sock.close();
isc_throw(Unexpected,"failed to connect to remote endpoint.");
}
sock.local_endpoint();
asio::ip::address local_address(local_endpoint.address());
+ // Close the socket.
+ sock.close();
+
// Return address of local endpoint.
return IOAddress(local_address);
}
EXPECT_GT(socket2, 0);
close(socket2);
+ // The following test is currently disabled for OSes other than
+ // Linux because interface detection is not implemented on them.
+ // @todo enable this test for all OSes once interface detection
+ // is implemented.
+#if defined(OS_LINUX)
// Open v4 socket to connect to broadcast address.
int socket3 = 0;
IOAddress bcastAddr("255.255.255.255");
);
EXPECT_GT(socket3, 0);
close(socket3);
+#endif
}
// TODO: disabled due to other naming on various systems