current_sockets.clear();
BOOST_FOREACH(const AddressPair &address, addresses) {
const int af(IOAddress(address.first).getFamily());
- // TODO: Support sharing somehow in future.
-
- // As for now, we hardcode the application name as dummy_app, because:
- // * we don't have a name available in our interface, which will change
- // soon anyway
- // * we use the DONT_SHARE mode, so the name is irrelevant anyway
+ // We use the application name supplied to the socket requestor on
+ // creation. So we can freely use the SHARE_SAME
const SocketRequestor::SocketID
tcp(socketRequestor().requestSocket(SocketRequestor::TCP,
address.first, address.second,
- SocketRequestor::DONT_SHARE));
+ SocketRequestor::SHARE_SAME));
current_sockets.push_back(tcp.second);
if (!test_mode) {
service.addServerTCPFromFD(tcp.first, af);
const SocketRequestor::SocketID
udp(socketRequestor().requestSocket(SocketRequestor::UDP,
address.first, address.second,
- SocketRequestor::DONT_SHARE));
+ SocketRequestor::SHARE_SAME));
current_sockets.push_back(udp.second);
if (!test_mode) {
service.addServerUDPFromFD(udp.first, af);
/// \param protocol The protocol to request
/// \param address to bind to
/// \param port to bind to
- /// \param mode checked to be DONT_SHARE for now
- /// \param name checked to be dummy_app for now
+ /// \param mode checked to be SHARE_SAME for now
+ /// \param name checked to be the same as expected_app parameter of the
+ /// constructor
/// \return The token and FD
/// \throw SocketAllocateError as described above, to test error handling
/// \throw ShareError as described above, to test error handling
const std::string proto(protocol == TCP ? "TCP" : "UDP");
const size_t number = ++ last_token_;
EXPECT_EQ(expect_port_, port);
- EXPECT_EQ(DONT_SHARE, mode);
+ EXPECT_EQ(SHARE_SAME, mode);
EXPECT_EQ(expected_app_, name);
const std::string token(proto + ":" + address + ":" +
boost::lexical_cast<std::string>(port) + ":" +