龙盟编程博客 | 无障碍搜索 | 云盘搜索神器
快速搜索
主页 > 软件开发 > JAVA开发 >

解决java网络编程IPv6带来的问题方法

时间:2009-12-23 15:42来源:未知 作者:admin 点击:
分享到:
以前用jgroups以及mantaray都碰到过这样的问题,蹩脚的做法禁止IPv6协议,今天学到的一招解决网络编程IPv6带来的问题!设置一个属性就可以了 -DJava.net.preferIPv4Stack=true 以后用jgroups可以设置

  

      以前用jgroups以及mantaray都碰到过这样的问题,蹩脚的做法禁止IPv6协议,今天学到的一招解决网络编程IPv6带来的问题!设置一个属性就可以了   -DJava.net.preferIPv4Stack=true   以后用jgroups可以设置一下就可以了,查阅sun官方文档解释如下:

     java.net.preferIPv4Stack (default: false) If IPv6 is available on the operating system the underlying native socket will be an IPv6 socket. This allows Java(tm) applications to connect too, and accept connections from, both IPv4 and IPv6 hosts. If an application has a preference to only use IPv4 sockets then this property can be set to true. The


  
精彩图集

赞助商链接