network-interface

Get current QNetworkInterface active and connected to the internet

半腔热情 提交于 2019-12-22 08:57:15
问题 I would like get the current network interface active and connected to the internet. Actually, I can check if a network is up and if is not a loop back network. foreach(QNetworkInterface interface, QNetworkInterface::allInterfaces()) { if (interface.flags().testFlag(QNetworkInterface::IsUp) && !interface.flags().testFlag(QNetworkInterface::IsLoopBack)) foreach (QNetworkAddressEntry entry, interface.addressEntries()) { if ( interface.hardwareAddress() != "00:00:00:00:00:00" && entry.ip()

Not receiving all network interfaces of an Android device

与世无争的帅哥 提交于 2019-12-20 07:10:55
问题 I'm trying to query network changes made to some specific network interfaces. I'm doing it by registering a BroadcastReceiver like this: <receiver android:name="com.my.app.ReceiverNetworkInterfaceChange"> <intent-filter> <action android:name="android.net.conn.CONNECTIVITY_CHANGE" /> </intent-filter> </receiver> And when there is a change, it triggers a method which query the interfaces using this call: final List<NetworkInterface> interfaces = Collections.list(NetworkInterface

Is there a way to get a list of disabled/enabled network interfaces in C#

末鹿安然 提交于 2019-12-20 01:45:51
问题 I am programming a little script to change the IPv4 address of a specific Wireless80211 or Ethernet network interface. So far everything is working fine. The script sets the IPv4 with the command prompt and netsh (to control it with C# I use System.Diagnostics ). I want to add the feature, that the script disables or enables all Wireless80211 and Ethernet network interfaces (without a specific one) which you can find in "Control Panel>Network and Internet>Network Connections". The script is

Windows console Bandwidth monitoring System

◇◆丶佛笑我妖孽 提交于 2019-12-12 02:55:26
问题 I am working on a Bandwidth monitoring system, i want it loop, displaying the amount of data being sent or received at a given instance, but the problem is that the system freezes when its processing, i just want it to work in background, displaying the results in the text boxes as defined in the system whilst i am doing other things. Here is the function: Private Function netSpeed() As Boolean Dim networkInterfaces As New System.Diagnostics.PerformanceCounterCategory("Network Interface") Dim

Java NetworkInterface getName() broken on windows?

给你一囗甜甜゛ 提交于 2019-12-12 01:46:05
问题 I am writing a program for windows which lists all network adapters and deactivates all except the one selected. I know how to modify network adapters with netsh, but the problem is I can't get the relevant information from the NetworkInterface class. The NetworkInterface class has the methods getName() and getDisplayName(), but they seem to produce only irrelevant data. I took the example directly from oracle: http://docs.oracle.com/javase/tutorial/networking/nifs/listing.html public class

MQTT: Can ping server and client machine, but can't connect to broker

痞子三分冷 提交于 2019-12-11 16:31:15
问题 I have a laptop with a NodeJS client that should connect to an MQTT broker on an Ubuntu PC. The broker is running with TCP port 1883 and websocket port 9883. But when I run the client, it does not see the broker - only if I run the client program on the same PC the broker is on, it connects. This used to work before. I changed a few things about the network interfaces but reverted everything - so I have no idea what might be causing this. I added an alias for one of the eth interfaces, but

java.net.NetworkInterface.getNetworkInterfaces() not listing all interfaces for OS X

蹲街弑〆低调 提交于 2019-12-11 06:38:03
问题 https://stackoverflow.com/a/17719579/2619129 provides a solution for Linux. I am looking for a similar solution for OS X, but not sure which files to read to get the list of Interfaces (file /proc/net/dev in linux) and then their HardwareAddresses (file /sys/class/net/devicename/address in linux). My ultimate goal is to list Mac-Addresses of all the NetworkInterfaces (which gets listed as result of ifconfig command) on OS X implemented in pure Java. 来源: https://stackoverflow.com/questions

Get name of a specific network interface in Java

。_饼干妹妹 提交于 2019-12-11 04:25:00
问题 I am using windows 10 and I would like to plug a device on my computer (which created a new network interface with the name "Ethernet 12" and description "foobar") and be able to set the IP address of this interface using Java. Using this link: Change Computer IP address using JAVA, I am able to configure the IP address of the interface. The issue I have is that I am not able, in java, to retrieve the name of the interface created by the device. From the documentation I found, I did the

How to get the network interface type

只谈情不闲聊 提交于 2019-12-11 04:10:01
问题 Is there an option to identify the network interface type in java. The reason for asking this question is some set of Sun hardware boxes have a special kind of interface (DSCP interface) used for internal communication. We have an application developed for Solaris platform and I want to print only non-internal common interfaces. To know more about DSCP http://blogs.oracle.com/olympus/entry/dscp 回答1: I know this isn't much of an answer, but here's a tutorial that details Programmatic Access to

NetworkInterface doesn't return all mac addresses

百般思念 提交于 2019-12-11 02:38:41
问题 In part of our code i am trying to bind a mac address with our license file and i am facing an issue that my code for figuring out all the mac addresses of the machine is not returning all the physical mac addresses. Here is the code to get all the mac addresses public static Collection<String> getAllLocalMacAddresses() throws IOException { final Enumeration<NetworkInterface> inetAddresses = NetworkInterface.getNetworkInterfaces(); final Collection<String> addresses = new LinkedList<String>()