[p2p-hackers] Re: Getting started with UPnP on Win32

coderman coderman at gmail.com
Fri Jul 8 22:07:20 UTC 2005


On 7/8/05, David Barrett <dbarrett at quinthar.com> wrote:
> On Fri, 8 Jul 2005 2:10 pm, Scott C. Best wrote:
> >       Any mention in there how it handles multiple WinXP PC's
> > on the LAN in contention for the same port-forwarding adjustment?
> 
> No.  Nor is there mention on lease durations, timeouts, or refresh
> periods.  Horray for well-designed Microsoft APIs!

a useful example of UPnP NAT forwarding between XP and Linksys is
given here (in VB):

http://www.knoxscape.com/Upnp/NAT.htm

you can see that there are a handful of common forwards available,
which are returned by the call to get_StaticPortMappingCollection( ). 
they are probably not actively forwarded to anything unless you
configured the services in XP and it did so for you.

you can add additional forwards as mentioned with
StaticPortMappingCollection::Add( ) but there is a low limit (5??) and
whoever gets the mapping first wins.  thus if you try to do this from
another application you will see the assignment already in place when
get_StaticPortMappingCollection( ) is called, and you would have to
explicitly remove it before adding it to a different internal
endpoint.

i'm not aware of any timeouts for the forwards unless the host DHCP
lease times out, and then even this is implementation / vendor
dependant.



More information about the P2p-hackers mailing list