cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject cxf git commit: [CXF-6795] Enable loopback mode for multicast sockets. This closes #113
Date Wed, 16 Mar 2016 14:51:09 GMT
Repository: cxf
Updated Branches:
  refs/heads/master 330272d73 -> bafe76605


[CXF-6795] Enable loopback mode for multicast sockets.
This closes #113


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/bafe7660
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/bafe7660
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/bafe7660

Branch: refs/heads/master
Commit: bafe766056ffb5bc060af36db41c5c0fe6948257
Parents: 330272d
Author: Nick Birnie <nick.birnie@seebyte.com>
Authored: Mon Feb 22 16:34:36 2016 +0000
Committer: Daniel Kulp <dkulp@apache.org>
Committed: Wed Mar 16 10:50:39 2016 -0400

----------------------------------------------------------------------
 .../src/main/java/org/apache/cxf/transport/udp/UDPConduit.java   | 4 ++++
 .../main/java/org/apache/cxf/transport/udp/UDPDestination.java   | 1 +
 .../java/org/apache/cxf/ws/discovery/WSDiscoveryClientTest.java  | 2 ++
 3 files changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/bafe7660/rt/transports/udp/src/main/java/org/apache/cxf/transport/udp/UDPConduit.java
----------------------------------------------------------------------
diff --git a/rt/transports/udp/src/main/java/org/apache/cxf/transport/udp/UDPConduit.java
b/rt/transports/udp/src/main/java/org/apache/cxf/transport/udp/UDPConduit.java
index 0326bb9..4df1900 100644
--- a/rt/transports/udp/src/main/java/org/apache/cxf/transport/udp/UDPConduit.java
+++ b/rt/transports/udp/src/main/java/org/apache/cxf/transport/udp/UDPConduit.java
@@ -243,6 +243,10 @@ public class UDPConduit extends AbstractConduit {
                 socket.setSendBufferSize(this.size());
                 socket.setReceiveBufferSize(64 * 1024);
                 socket.setBroadcast(true);
+                socket.setReuseAddress(true);
+                if (multicast != null) {
+                    ((MulticastSocket)socket).setLoopbackMode(false);
+                }
                 
                 if (multicast == null) {
                     Enumeration<NetworkInterface> interfaces = NetworkInterface.getNetworkInterfaces();

http://git-wip-us.apache.org/repos/asf/cxf/blob/bafe7660/rt/transports/udp/src/main/java/org/apache/cxf/transport/udp/UDPDestination.java
----------------------------------------------------------------------
diff --git a/rt/transports/udp/src/main/java/org/apache/cxf/transport/udp/UDPDestination.java
b/rt/transports/udp/src/main/java/org/apache/cxf/transport/udp/UDPDestination.java
index 3442ab2..8f8dfd8 100644
--- a/rt/transports/udp/src/main/java/org/apache/cxf/transport/udp/UDPDestination.java
+++ b/rt/transports/udp/src/main/java/org/apache/cxf/transport/udp/UDPDestination.java
@@ -172,6 +172,7 @@ public class UDPDestination extends AbstractDestination {
                 socket.setReceiveBufferSize(64 * 1024);
                 socket.setSendBufferSize(64 * 1024);
                 socket.setTimeToLive(1);
+                socket.setLoopbackMode(false);
                 socket.bind(new InetSocketAddress(isa.getPort()));
                 socket.setNetworkInterface(findNetworkInterface());
                 socket.joinGroup(isa.getAddress());

http://git-wip-us.apache.org/repos/asf/cxf/blob/bafe7660/services/ws-discovery/ws-discovery-api/src/test/java/org/apache/cxf/ws/discovery/WSDiscoveryClientTest.java
----------------------------------------------------------------------
diff --git a/services/ws-discovery/ws-discovery-api/src/test/java/org/apache/cxf/ws/discovery/WSDiscoveryClientTest.java
b/services/ws-discovery/ws-discovery-api/src/test/java/org/apache/cxf/ws/discovery/WSDiscoveryClientTest.java
index f44217d..3673206 100644
--- a/services/ws-discovery/ws-discovery-api/src/test/java/org/apache/cxf/ws/discovery/WSDiscoveryClientTest.java
+++ b/services/ws-discovery/ws-discovery-api/src/test/java/org/apache/cxf/ws/discovery/WSDiscoveryClientTest.java
@@ -110,6 +110,8 @@ public final class WSDiscoveryClientTest {
                     MulticastSocket s = new MulticastSocket(Integer.parseInt(PORT));
                     s.setBroadcast(true);
                     s.setNetworkInterface(findIpv4Interface());
+                    s.setLoopbackMode(false);
+                    s.setReuseAddress(true);
                     s.joinGroup(address);
                     s.setReceiveBufferSize(64 * 1024);
                     s.setSoTimeout(5000);


Mime
View raw message