为什么Android上的JGroups使用IPv6进行连接?

问题描述 投票:0回答:1

[我正在尝试通过Android设备在本地网络上建立通往Gossip路由器的隧道。我使用它作为配置:

<config xmlns="urn:org:jgroups"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="urn:org:jgroups http://www.jgroups.org/schema/JGroups-3.4.xsd">
    <TUNNEL gossip_router_hosts="${jgroups.tunnel.gossip_router_hosts:10.20.30.152[12001]}"/>
</config>

使用这样的代码:

channel = JChannel(context.getAssets().open("jgroups.xml"))
channel.setReceiver(this)
channel.connect("MyGroup")

但是,该应用默认情况下尝试通过IPv6连接,但似乎无法正常工作:

20096:connect(41, {sa_family=AF_INET6, sin6_port=htons(12001), inet_pton(AF_INET6, "::ffff:10.20.30.152", &sin6_addr), sin6_flowinfo=htonl(0), sin6_scope_id=0}, 28) = -1 ENETUNREACH (Network is unreachable)

即使从网络接口中删除任何IPv6地址,也会发生这种情况。我知道有一个支持IPv4的JVM标志,但是我认为这不适用于Android。通过adb设置选项也不是一个好的解决方案。

是否有另一种方法可以强制JGroups使用IPv4进行连接?还是有其他解决方法?

我已经在Android 8.0上进行了测试,并查看了JGroups 4.1.6和3.6.19版本的行为。

android jgroups
1个回答
0
投票

这是一个奇怪的配置!您确定要在其中包含only

© www.soinside.com 2019 - 2024. All rights reserved.