View | Details | Raw Unified | Return to bug 43641
Collapse All | Expand All

(-)java/org/apache/catalina/tribes/membership/McastServiceImpl.java (-2 / +17 lines)
Lines 29-34 Link Here
29
import org.apache.catalina.tribes.Channel;
29
import org.apache.catalina.tribes.Channel;
30
import org.apache.catalina.tribes.Member;
30
import org.apache.catalina.tribes.Member;
31
import org.apache.catalina.tribes.MembershipListener;
31
import org.apache.catalina.tribes.MembershipListener;
32
import java.net.BindException;
32
33
33
/**
34
/**
34
 * A <b>membership</b> implementation using simple multicast.
35
 * A <b>membership</b> implementation using simple multicast.
Lines 182-189 Link Here
182
    }
183
    }
183
    
184
    
184
    protected void setupSocket() throws IOException {
185
    protected void setupSocket() throws IOException {
185
        if (mcastBindAddress != null) socket = new MulticastSocket(new InetSocketAddress(mcastBindAddress, port));
186
        if (mcastBindAddress != null) {
186
        else socket = new MulticastSocket(port);
187
            try {
188
                log.info("Attempting to bind the multicast socket to "+address+":"+port);
189
                socket = new MulticastSocket(new InetSocketAddress(address,port));
190
            } catch (BindException e) {
191
                /*
192
                 * On some plattforms (e.g. Linux) it is not possible to bind
193
                 * to the multicast address. In this case only bind to the
194
                 * port.
195
                 */
196
                log.info("Binding to multicast address, failed. Binding to port only.");
197
                socket = new MulticastSocket(port);
198
            }
199
        } else {
200
            socket = new MulticastSocket(port);
201
        }
187
        socket.setLoopbackMode(false); //hint that we don't need loop back messages
202
        socket.setLoopbackMode(false); //hint that we don't need loop back messages
188
        if (mcastBindAddress != null) {
203
        if (mcastBindAddress != null) {
189
			if(log.isInfoEnabled())
204
			if(log.isInfoEnabled())

Return to bug 43641