标签:add group method ati ctp span 编程 rac cte
在用Java编写了一个udp生产者和消费者的demo时,在生产者启动的时候会抛出异常
java.net.SocketException: Can‘t assign requested address at java.net.PlainDatagramSocketImpl.join(Native Method) at java.net.AbstractPlainDatagramSocketImpl.join(AbstractPlainDatagramSocketImpl.java:178) at java.net.MulticastSocket.joinGroup(MulticastSocket.java:323) at com.yanwu.demo.java.socket.udp.Producer.<init>(Producer.java:41) at com.yanwu.demo.java.socket.udp.Producer.main(Producer.java:71)
解决方案:
在jvm的启动参数中添加-Djava.net.preferIPv4Stack=true.
标签:add group method ati ctp span 编程 rac cte
原文地址:https://www.cnblogs.com/yanwu0527/p/10068292.html