Results 1 to 8 of 8

Thread: Connecting computers using Winsock behind a router

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Apr 2006
    Location
    Sweden
    Posts
    173

    Unhappy Connecting computers using Winsock behind a router

    Hi,

    I've managed to connect two computers using Winsock for p2p chat. But what do I need to do to connect two computers from different networks (through the internet)?

    So the first computer is behind a router, and so is the second one.

    Has anyone got this problem before?

    //Alex
    Please Help Us To Save Ana

    You never fail before you stop trying!
    ______________________________
    If I manage to say something good...please reputate
    ______________________________
    ________

    Links:
    Intellithing
    Digitala.nu
    Norrköpings Goklubb
    WoW Trade Center

  2. #2
    Fanatic Member
    Join Date
    Sep 2005
    Location
    Toledo, OH
    Posts
    785

    Re: Connecting computers using Winsock behind a router

    are you getting no connection for the two computers? if so it's because of the router firewall, you have to enable the port on the firewall..

  3. #3
    "Digital Revolution"
    Join Date
    Mar 2005
    Posts
    4,471

    Re: Connecting computers using Winsock behind a router

    I think this gets asked a few times a week.

    1. If you have a firewall, open the ports.
    2. If you have a router, open the port for your computer through the port forwarding settings.

  4. #4
    Member
    Join Date
    Jun 2006
    Posts
    55

    Re: Connecting computers using Winsock behind a router

    I have the same problem as cyber_alex, and I've tried everything, it still doesn't work. The application still shows my local IP, and my computer is still unconnectable through my external IP. The only way to make it work is to disconnect the entire router, and directly connect my computer to the modem.

    I therefore think that you can't solve this problem by just opening some ports, since your router still allots you a local IP even if you open every damn port; you're still a part of the network.
    There must be another way - take a serious computer game for instance, something like... Counter-strike (JUST AN EXAMPLE). You never have to make things difficult there, absolutely not more than just shut off the windows firewall... (I don't have any other firewall software) It always works. The same with all the proffesional games you can buy in the store.

    So, how do those proffesional games do? Why can't I use the same technique?
    //¤dark
    Dinmamma.Fat = True

  5. #5
    "Digital Revolution"
    Join Date
    Mar 2005
    Posts
    4,471

    Re: Connecting computers using Winsock behind a router

    Quote Originally Posted by henzino2
    I have the same problem as cyber_alex, and I've tried everything, it still doesn't work. The application still shows my local IP, and my computer is still unconnectable through my external IP. The only way to make it work is to disconnect the entire router, and directly connect my computer to the modem.

    I therefore think that you can't solve this problem by just opening some ports, since your router still allots you a local IP even if you open every damn port; you're still a part of the network.
    There must be another way - take a serious computer game for instance, something like... Counter-strike (JUST AN EXAMPLE). You never have to make things difficult there, absolutely not more than just shut off the windows firewall... (I don't have any other firewall software) It always works. The same with all the proffesional games you can buy in the store.

    So, how do those proffesional games do? Why can't I use the same technique?
    If you have to disconnect from the router and go straight to the modem then you haven't setup your router settings correctly. Or there is something else standing in the way.

    When setting up port forwarding settings, you enter your computer's LAN IP address, the port numbers, select TCP/UDP, and click enable.

    If all else fails, you can enable DMZ hosting for your IP address which will essentially open all ports.

    This applies to all software, games too. Games may have uPnP built in that can configure the router automatically, but the same rules still apply. There is no "Special technique" they are using.

  6. #6
    Member
    Join Date
    Jun 2006
    Posts
    55

    Re: Connecting computers using Winsock behind a router

    OH YES! THANK YOU ALOT DIGIREV! That DMZ hosting thing works, everything works now!

    One more thing, you mentioned something about uPnP, how do I use that? Because I doubt that my friends, who are not so used to computers, will have any clue how to enable DMZ, open ports, etc... Can it be used in vb6?
    //¤dark
    Dinmamma.Fat = True

  7. #7
    Fanatic Member drivenbywhat's Avatar
    Join Date
    Jan 2007
    Location
    VA - USA
    Posts
    866

    Re: Connecting computers using Winsock behind a router

    henzino2, unless you are an expert programmer, coding upnp isn't just something anyone can do. Also, most games that are well known have an advantage over other games. Router/firewall manufacturers already configure these ports to be opened before that router is sold to you. For example, the battlenet servers are pre-configured on my router. So is AIM & MSN. Futhermore, when you use those games, you are connecting to a server that is in between you and the other players. In your p2p chat program, your routers are the ones in between you and your friend.
    [vb5 & starting to move to vb2008] I appreciate the help I get from everyone. Thank you.

  8. #8
    "Digital Revolution"
    Join Date
    Mar 2005
    Posts
    4,471

    Re: Connecting computers using Winsock behind a router

    Quote Originally Posted by henzino2
    OH YES! THANK YOU ALOT DIGIREV! That DMZ hosting thing works, everything works now!

    One more thing, you mentioned something about uPnP, how do I use that? Because I doubt that my friends, who are not so used to computers, will have any clue how to enable DMZ, open ports, etc... Can it be used in vb6?
    Echoing what driven said. I wouldn't bother with uPnP in your program. For one, I'm not sure how to do it, and it's not reliable. There are still a lot of routers that don't support uPnP and that implement things in different ways.

    Just understand that, while DMZ makes things easier, it's insecure. You are no longer protected by your router. If DMZ worked, then chances are, port forwarding works too you just had it setup incorrectly.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width