package nxm.net.lib;

import java.net.MulticastSocket;

/** ************ VERSION FOR UP TO AND INCLUDING JDK11 ***************
 *  Code related to setting MulticastSocket options that is only
 *  compatible up to jdk11 has been moved into a Swap class to enable
 *  automatic swapping of jdk11 compatible code.
 *
 *  @author MSZ / JPH
 *  @since  NeXtMidas 3.7.2, but moved in NeXtMidas 4.1.1
 */
class MulticastSocketOptionsSwap {

  static void setLoopBackMode(MulticastSocket msock, boolean disable) {
    try {
      msock.setLoopbackMode(disable);
    } catch (Exception e) {
      e.printStackTrace();
    }
  }

  static boolean getLoopBackMode (MulticastSocket msock) {
    try {
      msock.getLoopbackMode();
    } catch (Exception e) {
      e.printStackTrace();
    }
    return false;
  }

}
