Class 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