Java Multicast Time To Live is always 0

前端 未结 2 1392
面向向阳花
面向向阳花 2020-12-07 01:24

I have a problem with setting the TTL on my Datagram packets. I am calling the setTTL(...) method on the packet before sending the packet to the multicastSocket but if I ca

相关标签:
2条回答
  • 2020-12-07 02:08

    Basically you have to set an special system property telling the JVM to use an IPv4 stack:

    -Djava.net.preferIPv4Stack=true
    
    0 讨论(0)
  • 2020-12-07 02:18

    To implement pfranza's fix in Oracle, where you don't have a command line:

    Set the property java.net.preferIPv4Stack=true in each Oracle session as follows before calling the java code containing the multicast call with the following PL/SQL snippet:

    ret := dbms_java.set_property('java.net.preferIPv4Stack','true');
    

    If the call is successful it will return NULL.

    0 讨论(0)
提交回复
热议问题