PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197

PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197 Help with port forwarding in winsock-VBForums

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Re: Help with port forwarding in winsock

Sorry, I am trying to use the winsock control to send/receive data from the internet . The internet connection is done through a broadband router. The applications (code for which is posted above) are used for sending and receiving data.

I was advised to use port forwarding for doing this..The router settings are also given.

Re: Help with port forwarding in winsock

So someone will connect from the outside world directly into your computer?
If your computer is establishing the connection out from your computer to another host on the internet then you don't need to use port forwarding - even for the inbound data on that connection.

Re: Help with port forwarding in winsock

Re: Help with port forwarding in winsock

Winsock works the same, whether you're port forwarding or not.

Your problem is that you set up port triggering, not port forwarding - they're not the same thing. Set the computer the Winsock program will be running on to have a static internal IP that's outside the range of the DHCP server in the router. IOW, if the DHCP server leases .100 to .254, use an IP in the range of .2 to .99. (If the DHCP server leases .2 to .254, you're going to have to change that range in the router, because all addresses except the gateway are leased.)

Note: Some routers will forward to leased addresses, others won't. ALL routers will forward to static (non-leased) addresses, so it doesn't hurt to just set a static address, unless you know that your router will forward to a leased address. (Which will cause you problems if you ever boot the computers on the LAN in a different order - the one needing forwarding will have the wrong address.)

Now just forward whatever port(s) you're using to that address. (Use Both [TCP and UDP] unless you know which type of traffic you're looking for). This is for incoming connections - connections that your program initiates will work whether you have ports forwarded or not. (Port 80 is blocked, yet your web browser works just fine initiating connections on port 80.)

Connections from outside your router are made to your external address - the one you see when you connect to http://www.whatsmyip.org/. Connections from inside the LAN are made to your 192.168.1.<whatever> address. Some routers will loop back - do an internal connection if the address you're going to is the router's external address - some won't know how to handle the request and you'll never connect, so use the internal address from inside.

Last edited by Al42; Aug 17th, 2006 at 02:55 PM.

The most difficult part of developing a program is understanding the problem.The second most difficult part is deciding how you're going to solve the problem.Actually writing the program (translating your solution into some computer language) is the easiest part.
Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read.Please Help Us To Save Ana