Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed error sending multicast on Windows in some scenarios. [4542] #394

Merged
merged 2 commits into from
Jan 31, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/cpp/transport/UDPTransportInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -276,13 +276,16 @@ bool UDPTransportInterface::OpenAndBindOutputSockets(const Locator_t& locator)
eProsimaUDPSocket unicastSocket = OpenAndBindUnicastOutputSocket(GenerateAnyAddressEndpoint(port), port);
getSocketPtr(unicastSocket)->set_option(ip::multicast::enable_loopback(true));

// Outbounding first interface with already created socket.
if(!locNames.empty())
{
SetSocketOutbountInterface(unicastSocket, (*locNames.begin()).name);
}

// If more than one interface, then create sockets for outbounding multicast.
if (locNames.size() > 1)
{
auto locIt = locNames.begin();

// Outbounding first interface with already created socket.
SetSocketOutbountInterface(unicastSocket, (*locIt).name);
mOutputSockets.push_back(new UDPChannelResource(unicastSocket));

// Create other socket for outbounding rest of interfaces.
Expand Down
1 change: 1 addition & 0 deletions src/cpp/utils/IPFinder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ bool IPFinder::getIPs(std::vector<info_IP>* vec_name, bool return_loopback)
info_IP info;
info.type = family == AF_INET ? IP4 : IP6;
info.name = std::string(buf);
info.dev = std::string(aa->AdapterName);

// Currently not supported interfaces that not support multicast.
if(aa->Flags & 0x0010)
Expand Down