CXF-6795 WS-Discovery add support for discovery on localhost #113
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This addresses the feature request to add loopback support for UDP transport and hence WS-Discovery.
https://issues.apache.org/jira/browse/CXF-6795
There was some code which was attempting to guess which network interface to use for multicast purposes. I have left the ability to configure a specific interface to use, but I removed the code which tried to guess a default interface since this is best handled by the operating system's routing table. The algorithm was essentially making an arbitrary choice from the available network interfaces, except the loopbacks. However, it is still possible and in many circumstances desirable to run multicast on the loopback adapter. This requires the MulticastSocket to be configured with the setLoopbackMode(false) and setReuseAddress(true) options in order to receive packets which were sent from the local machine.
In some circumstances, this will not be required, but it shouldn't cause a major issue since the WS-D packets are so small. Perhaps someone can comment on impact outside of WS-D for other user of UDPTransport's multicast capability?