public class NATUtils extends Object
Constructor and Description |
---|
NATUtils()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
mapPMP(int internalPortUDP,
int internalPortTCP,
int externalPortUDP,
int externalPortTCP)
Maps with the PMP protocol
(http://en.wikipedia.org/wiki/NAT_Port_Mapping_Protocol).
|
boolean |
mapUPNP(String internalHost,
int internalPortUDP,
int internalPortTCP,
int externalPortUDP,
int externalPortTCP)
Maps with UPNP protocol
(http://en.wikipedia.org/wiki/Internet_Gateway_Device_Protocol).
|
void |
shutdown()
Since shutdown is also called from the shutdown hook, it might get called
twice.
|
public boolean mapPMP(int internalPortUDP, int internalPortTCP, int externalPortUDP, int externalPortTCP) throws NatPmpException
internalPortUDP
- The UDP internal portinternalPortTCP
- The TCP internal portexternalPortUDP
- The UDP external portexternalPortTCP
- The TCP external portNatPmpException
- the router does not supports PMPpublic boolean mapUPNP(String internalHost, int internalPortUDP, int internalPortTCP, int externalPortUDP, int externalPortTCP) throws IOException
internalHost
- The internal host to map the ports tointernalPortUDP
- The UDP internal portinternalPortTCP
- The TCP internal portexternalPortUDP
- The UDP external portexternalPortTCP
- The TCP external portIOException
- Exceptionpublic void shutdown()
Copyright © 2013. All Rights Reserved.