Class DatagramChannelFactoryImpl
- java.lang.Object
-
- org.jboss.modcluster.advertise.impl.DatagramChannelFactoryImpl
-
- All Implemented Interfaces:
DatagramChannelFactory
public class DatagramChannelFactoryImpl extends Object implements DatagramChannelFactory
On Linux-like systems, we attempt to avoid cross-talk problem by binding the DatagramChannel to the multicast address, if possible. If not possible, default to binding only to the port. See {@link JGRP-777}.On Windows-like systems, we do not attempt to bind the socket to the multicast address, we only bind to the port.
On BSD-like systems (e.g. OS X) we also need to bind the DatagramChannel to the multicast address. If httpd with mod_proxy_cluster (which is bound to the multicast address) is running on the same system, the AdvertiseListener would not be able to bind to any address (i.e. only binding to the port without the address) because JDK does not expose SO_REUSEPORT as a socket option which would be required for this to work. This is to be supported since JDK 9. See {@link JDK-6432031}.
- Author:
- Paul Ferraro, Radoslav Husar
-
-
Constructor Summary
Constructors Constructor Description DatagramChannelFactoryImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DatagramChannel
createDatagramChannel(InetSocketAddress multicastSocketAddress)
-
-
-
Method Detail
-
createDatagramChannel
public DatagramChannel createDatagramChannel(InetSocketAddress multicastSocketAddress) throws IOException
- Specified by:
createDatagramChannel
in interfaceDatagramChannelFactory
- Throws:
IOException
-
-