【发布时间】:2019-02-04 07:22:28
【问题描述】:
我怎么知道哪个接口允许 UPD 连接? 我得到所有网络接口的列表,如下所示:
Enumeration<NetworkInterface> networkInterfaceEnumeration = NetworkInterface.getNetworkInterfaces();
$ ipconfig
Windows IP Configuration
Ethernet adapter Local Area Connection:
Connection-specific DNS Suffix . : myworld.com
IPv4 Address. . . . . . . . . . . : 10.219.1.157
Subnet Mask . . . . . . . . . . . : 255.255.254.0
Default Gateway . . . . . . . . . : 10.219.0.1
Tunnel adapter isatap.myworld.com:
Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . : myworld.com
【问题讨论】:
-
嗨奥利弗,这不是一个重复的问题。由于基于 Windows 的 ipconfig 不提供详细信息,例如列出所有接口、支持的连接类型等。因此,我必须遍历所有接口来测试我的 UDP 连接。
标签: windows networking