NetworkInterface getMTU Example
NetworkInterface class getMTU example. This example shows you how to use getMTU method.
NetworkInterface class getMTU example. public int getMTU() throws SocketException Returns the Maximum Transmission Unit (MTU) of this interface.
Here is the code
/*
* @ # GetMTU.java
* A class repersenting use to GetMTU method
* of URL class in java.net package
* version 23 June 2008
* author Rose India
*/
import java.net.*;
public class GetMTU {
public static void main(String args[]) throws Exception {
NetworkInterface networkInterface =
NetworkInterface.getByName("eth0");
System.out.println("Maximum Transmission Unit" +
networkInterface.getMTU());
}
} |
|