ASF Bugzilla – Attachment 20999 Details for
Bug 43641
Using the bind attribute for Membership tag causes Multicast to break
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Formatted patch
patch.txt (text/plain), 1.68 KB, created by
Filip Hanik
on 2007-10-17 10:58:54 UTC
(
hide
)
Description:
Formatted patch
Filename:
MIME Type:
Creator:
Filip Hanik
Created:
2007-10-17 10:58:54 UTC
Size:
1.68 KB
patch
obsolete
>Index: java/org/apache/catalina/tribes/membership/McastServiceImpl.java >=================================================================== >--- java/org/apache/catalina/tribes/membership/McastServiceImpl.java (revision 585602) >+++ java/org/apache/catalina/tribes/membership/McastServiceImpl.java (working copy) >@@ -29,6 +29,7 @@ > import org.apache.catalina.tribes.Channel; > import org.apache.catalina.tribes.Member; > import org.apache.catalina.tribes.MembershipListener; >+import java.net.BindException; > > /** > * A <b>membership</b> implementation using simple multicast. >@@ -182,8 +183,22 @@ > } > > protected void setupSocket() throws IOException { >- if (mcastBindAddress != null) socket = new MulticastSocket(new InetSocketAddress(mcastBindAddress, port)); >- else socket = new MulticastSocket(port); >+ if (mcastBindAddress != null) { >+ try { >+ log.info("Attempting to bind the multicast socket to "+address+":"+port); >+ socket = new MulticastSocket(new InetSocketAddress(address,port)); >+ } catch (BindException e) { >+ /* >+ * On some plattforms (e.g. Linux) it is not possible to bind >+ * to the multicast address. In this case only bind to the >+ * port. >+ */ >+ log.info("Binding to multicast address, failed. Binding to port only."); >+ socket = new MulticastSocket(port); >+ } >+ } else { >+ socket = new MulticastSocket(port); >+ } > socket.setLoopbackMode(false); //hint that we don't need loop back messages > if (mcastBindAddress != null) { > if(log.isInfoEnabled())
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 43641
:
20995
| 20999