offbynull / portmapper

Java library that maps ports on NAT-enabled routers (supported protocols: UPnP-IGD/NAT-PMP/PCP).
Apache License 2.0
88 stars 17 forks source link

Does this support regular UPNP? #38

Closed jredfox closed 6 years ago

jredfox commented 6 years ago

hi I have been looking for a port opener simple code to implement for UPNP and NAT-PMP so when one fails I use the other. Does this support regular UPNP if not could you add support? I tried cling but, there were compile errors everywhere after a maul painful installation.

I would also like some examples of how to open/keep-open a port as well as how to close it. I am not familiar with open/closing ports if your app closes via task manager does the port still stay open?

offbynull commented 6 years ago

Hey,

It does support UPnP. The quickstart example in the README shows you how to open a port, keep it open, and then close it. If the application is terminated abruptly (e.g. via task manager), the port stays open for some duration. There's nothing you can really do work around this.

The README should cover everything you need to know.