net.i2p.router.transport.udp
Class MTU
java.lang.Object
net.i2p.router.transport.udp.MTU
abstract class MTU
- extends Object
Get the MTU for the network interface of an address.
Not available until Java 6 / Android API 9.
- Since:
- 0.9.2
Constructor Summary |
MTU()
|
Method Summary |
static int |
getMTU(InetAddress ia)
The MTU for the socket interface, if available. |
static int |
rectify(int mtu)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MTU
MTU()
getMTU
public static int getMTU(InetAddress ia)
- The MTU for the socket interface, if available.
Not available for Java 5.
- Parameters:
ia
- null ok
- Returns:
- 0 if Java 5, or if not bound to an address;
limited to range MIN_MTU to LARGE_MTU.
rectify
public static int rectify(int mtu)
- Returns:
- min of PeerState.MIN_MTU, max of PeerState.LARGE_MTU,
rectified so rv % 16 == 12