473,412 Members | 2,277 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,412 software developers and data experts.

UPnP NAT Traversal

I'm writing a VB app in Visual Studio 2005 where I'd like to automatically
setup inbound port mappings for the user on their home router. I've been
playing with trying to use the NATUPnP 1.0 Type Library (hnetcfg.dll) and
have had no luck. From what I've read the library is friendly enough that
it should be as simple as adding the reference to the NATUPnP 1.0 Type
Library and doing some pretty mindless code (for example):

Private Function GetPortMappingCount() as Integer
Dim Router as New UPnPNAT()

' Obviously in real life, I'd do some error checking here :)

Return Router.StaticPortMappingCollection.Count
End Function

However, the StaticPortMappingCollection (as well as the NATEventManager)
ends up as Nothing and so throws an exception.

Anyone who is even vaguely familiar with this stuff? I've seen sample code
in C# that I've compiled with similar results. I know I have a UPnP
capable router. A packet sniff shows that the router isn't being queried
at all, so I'm obviously doing something wrong here and hopefully it's just
a simple oversight!
Sep 2 '06 #1
1 3296
I'm obviously doing something wrong here and
hopefully it's just a simple oversight!
Doh! My Windows based firewall was blocking UDP port 1900 traffic from my
router. Now that the traffic is allowed, the NAT traversal is working
fine. And it really _is_ easy!
Sep 2 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Ben Last | last post by:
I've been messing around with my Netgear MP101 and alternate servers. I like the MP101, but the server that comes with it leaves a lot to be desired (like you need to have it running on a...
0
by: Geoff Aukett | last post by:
Hello, Does anyone know of any .NET code to deal Upnp. I would like to create a windows service that will communicate with a wireless Upnp device. I have been to the Upnp forum but its all very...
0
by: bsimaie | last post by:
Hello, could somebody help me to convert the below UPnP service filr to WSDL web servive file: <serviceList> <service> <serviceType> urn:schemas-upnp-org:service:PowerSwitch:1 </serviceType>...
1
by: Robert S | last post by:
Hello, could somebody help me to convert the below UPnP service file to WSDL web service file: <serviceList> <service> <serviceType> urn:schemas-upnp-org:service:PowerSwitch:1 </serviceType>...
0
by: Robert S | last post by:
Hello group, I tried to combine UPnP servive and blenderpowerSCPD.xml and come up with WSDL web service file as below: UPnP services: <serviceList>
0
by: nezoat | last post by:
Here is some working code to open the specified TCP port on the gateway nat device or firewall, and forward it to the calling machine. Great for p2p apps. The newsgroups are such a great...
6
by: GrispernMix | last post by:
//ques and and level order traversal file name: lab6_build_leaf_up.cpp Instructions:
1
by: xlar54 | last post by:
Ive searched around and Im hazy on what is needed to develop media server code. Is there a UPnP library for C#? Linux apparently has many, and I even found a Java one, but can't locate anything...
2
by: Svinja | last post by:
Hello, I am using UPnP in c# to communicate with my router. So far i have managed to do this: 1. Get router info(xml) 2. Get external(public) IP address 3. Add and delete port mapping Is...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.