You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2023/01/12 22:23:58 UTC

[tomcat] branch main updated: Fix copy/paste error

This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/main by this push:
     new 9bcdbc4d41 Fix copy/paste error
9bcdbc4d41 is described below

commit 9bcdbc4d41585396e5eabd849acd5252677472db
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Thu Jan 12 22:23:30 2023 +0000

    Fix copy/paste error
---
 test/org/apache/catalina/tribes/TesterMulticast.java | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/test/org/apache/catalina/tribes/TesterMulticast.java b/test/org/apache/catalina/tribes/TesterMulticast.java
index 3e85687eea..10bb48bbb2 100644
--- a/test/org/apache/catalina/tribes/TesterMulticast.java
+++ b/test/org/apache/catalina/tribes/TesterMulticast.java
@@ -18,8 +18,8 @@ package org.apache.catalina.tribes;
 
 import java.net.DatagramPacket;
 import java.net.InetAddress;
+import java.net.InetSocketAddress;
 import java.net.MulticastSocket;
-import java.net.NetworkInterface;
 import java.net.StandardSocketOptions;
 import java.net.UnknownHostException;
 
@@ -83,8 +83,7 @@ public class TesterMulticast {
         public void run() {
             try (MulticastSocket s = new MulticastSocket(PORT)) {
                 s.setOption(StandardSocketOptions.IP_MULTICAST_LOOP, Boolean.TRUE);
-                NetworkInterface networkInterface = NetworkInterface.getByInetAddress(INET_ADDRESS);
-                s.setNetworkInterface(networkInterface);
+                s.joinGroup(new InetSocketAddress(INET_ADDRESS, 0), null);
                 DatagramPacket p = new DatagramPacket(new byte[4], 4);
                 p.setAddress(INET_ADDRESS);
                 p.setPort(PORT);
@@ -111,8 +110,7 @@ public class TesterMulticast {
         public void run() {
             try (MulticastSocket s = new MulticastSocket(PORT)) {
                 s.setOption(StandardSocketOptions.IP_MULTICAST_LOOP, Boolean.TRUE);
-                NetworkInterface networkInterface = NetworkInterface.getByInetAddress(INET_ADDRESS);
-                s.setNetworkInterface(networkInterface);
+                s.joinGroup(new InetSocketAddress(INET_ADDRESS, 0), null);
                 DatagramPacket p = new DatagramPacket(new byte[4], 4);
                 p.setAddress(INET_ADDRESS);
                 p.setPort(PORT);


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org