CodeGuru Forums -
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic Newsletters VB Forums Developer.com


Newest CodeGuru.com Articles:

  • Faltering Windows support
  • Internet Explorer 8 Click Clever Click Safe
  • Release Candidate 2 for ASP.NET MVC 2
  • Learn How to Create Dual Mode Windows Services

  • Search CodeGuru:
     



    Go Back   CodeGuru Forums > .NET Programming > C-Sharp Programming
    FAQ Members List Calendar Search Today's Posts Mark Forums Read

    C-Sharp Programming Post questions, answers, and comments about C#.

    Reply
     
    Thread Tools Search this Thread Rate Thread Display Modes
      #1    
    Old August 30th, 2009, 10:44 AM
    Gbates Gbates is offline
    Junior Member
     
    Join Date: Aug 2009
    Posts: 19
    Gbates is an unknown quantity at this point (<10)
    How do I open a router port?

    I want to connect 2 computers one of them is connected to a router, and therefore it blocks unknown ports.

    what do I do?
    Reply With Quote
      #2    
    Old August 30th, 2009, 02:14 PM
    Gbates Gbates is offline
    Junior Member
     
    Join Date: Aug 2009
    Posts: 19
    Gbates is an unknown quantity at this point (<10)
    Re: How do I open a router port?

    18 views with no reply?
    Reply With Quote
      #3    
    Old August 30th, 2009, 02:56 PM
    sotoasty sotoasty is offline
    Senior Member
     
    Join Date: Sep 2000
    Location: FL
    Posts: 1,278
    sotoasty is a name known to all (1000+) sotoasty is a name known to all (1000+) sotoasty is a name known to all (1000+) sotoasty is a name known to all (1000+) sotoasty is a name known to all (1000+) sotoasty is a name known to all (1000+) sotoasty is a name known to all (1000+) sotoasty is a name known to all (1000+) sotoasty is a name known to all (1000+)
    Re: How do I open a router port?

    Not really a question for programming forums. You will need to check out the manual on your SPECIFIC type of router.
    Reply With Quote
      #4    
    Old August 30th, 2009, 04:33 PM
    Mutant_Fruit Mutant_Fruit is offline
    Senior Member
     
    Join Date: May 2007
    Posts: 1,233
    Mutant_Fruit is a splendid one to behold (750+) Mutant_Fruit is a splendid one to behold (750+) Mutant_Fruit is a splendid one to behold (750+) Mutant_Fruit is a splendid one to behold (750+) Mutant_Fruit is a splendid one to behold (750+) Mutant_Fruit is a splendid one to behold (750+) Mutant_Fruit is a splendid one to behold (750+)
    Re: How do I open a router port?

    Quote:
    18 views with no reply
    You wait more than 3 hours to get a reply

    http://projects.qnetp.net/projects/show/mono-nat
    __________________
    www.monotorrent.com For all your .NET bittorrent needs

    NOTE: My code snippets are just snippets. They demonstrate an idea which can be adapted by you to solve your problem. They are not 100% complete and fully functional solutions equipped with error handling.
    Reply With Quote
      #5    
    Old August 30th, 2009, 04:38 PM
    dglienna's Avatar
    dglienna dglienna is offline
    ex MVP - Visual Basic
    Power Poster
     
    Join Date: Jan 2006
    Location: Chicago, IL
    Posts: 10,288
    dglienna has a brilliant future (2000+) dglienna has a brilliant future (2000+) dglienna has a brilliant future (2000+) dglienna has a brilliant future (2000+) dglienna has a brilliant future (2000+) dglienna has a brilliant future (2000+) dglienna has a brilliant future (2000+) dglienna has a brilliant future (2000+) dglienna has a brilliant future (2000+) dglienna has a brilliant future (2000+) dglienna has a brilliant future (2000+)
    Re: How do I open a router port?

    Use an OPEN port on the router. No program can change the router settings. But, all routers have SOME open ports turned on by default. Find one...
    __________________
    David CodeGuru Article: Bound Controls are Evil-VB6
    101 Samples: VB & C# VS2008 Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!
    Reply With Quote
      #6    
    Old August 30th, 2009, 04:59 PM
    Mutant_Fruit Mutant_Fruit is offline
    Senior Member
     
    Join Date: May 2007
    Posts: 1,233
    Mutant_Fruit is a splendid one to behold (750+) Mutant_Fruit is a splendid one to behold (750+) Mutant_Fruit is a splendid one to behold (750+) Mutant_Fruit is a splendid one to behold (750+) Mutant_Fruit is a splendid one to behold (750+) Mutant_Fruit is a splendid one to behold (750+) Mutant_Fruit is a splendid one to behold (750+)
    Re: How do I open a router port?

    Quote:
    Originally Posted by dglienna View Post
    Use an OPEN port on the router. No program can change the router settings.
    Both nat-pmp (http://en.wikipedia.org/wiki/NAT_Port_Mapping_Protocol) and upnp (http://en.wikipedia.org/wiki/Universal_Plug_and_Play) would beg to differ.
    __________________
    www.monotorrent.com For all your .NET bittorrent needs

    NOTE: My code snippets are just snippets. They demonstrate an idea which can be adapted by you to solve your problem. They are not 100% complete and fully functional solutions equipped with error handling.
    Reply With Quote
      #7    
    Old August 31st, 2009, 04:52 AM
    Gbates Gbates is offline
    Junior Member
     
    Join Date: Aug 2009
    Posts: 19
    Gbates is an unknown quantity at this point (<10)
    Re: How do I open a router port?

    I want to connect 2 computers via C# with a component (like winsock in VB6) . For that I will have to get IP and port from the client, but when I tried To connect the 2 computers one of them (the computer which is connected to the router) couldn't connect because the router blocked the port.
    Reply With Quote
      #8    
    Old August 31st, 2009, 08:28 AM
    sotoasty sotoasty is offline
    Senior Member
     
    Join Date: Sep 2000
    Location: FL
    Posts: 1,278
    sotoasty is a name known to all (1000+) sotoasty is a name known to all (1000+) sotoasty is a name known to all (1000+) sotoasty is a name known to all (1000+) sotoasty is a name known to all (1000+) sotoasty is a name known to all (1000+) sotoasty is a name known to all (1000+) sotoasty is a name known to all (1000+) sotoasty is a name known to all (1000+)
    Re: How do I open a router port?

    Quote:
    Originally Posted by Gbates View Post
    I want to connect 2 computers via C# with a component (like winsock in VB6) . For that I will have to get IP and port from the client, but when I tried To connect the 2 computers one of them (the computer which is connected to the router) couldn't connect because the router blocked the port.
    That is what most home routers are supposed to do. That keeps the rest of the world from breaking into your computer and installing crap like spyware, root kits and spambots.

    As I stated above, you need to read the manual for the router and see how to open the ports on that SPECIFIC router. They are all different. We can't help you on this.

    Now if you replace the router with a switch or hub, and are still having problems, then you need to check the firewall on the computers. And if you still have problems, check the AntiVirus/Network Security. Symantec, now has what is call "EndPoint Protection". Their version of the firewall and believe me, it sucks. After you go through all this, if there is a programming error, then we can probably help you.
    Reply With Quote
      #9    
    Old August 31st, 2009, 08:56 AM
    Mutant_Fruit Mutant_Fruit is offline
    Senior Member
     
    Join Date: May 2007
    Posts: 1,233
    Mutant_Fruit is a splendid one to behold (750+) Mutant_Fruit is a splendid one to behold (750+) Mutant_Fruit is a splendid one to behold (750+) Mutant_Fruit is a splendid one to behold (750+) Mutant_Fruit is a splendid one to behold (750+) Mutant_Fruit is a splendid one to behold (750+) Mutant_Fruit is a splendid one to behold (750+)
    Re: How do I open a router port?

    Quote:
    As I stated above, you need to read the manual for the router and see how to open the ports on that SPECIFIC router. They are all different. We can't help you on this.
    Erm... see both of my previous posts...

    This is not possible, but there are standardised ways of doing this.
    __________________
    www.monotorrent.com For all your .NET bittorrent needs

    NOTE: My code snippets are just snippets. They demonstrate an idea which can be adapted by you to solve your problem. They are not 100% complete and fully functional solutions equipped with error handling.
    Reply With Quote
      #10    
    Old August 31st, 2009, 09:59 AM
    sotoasty sotoasty is offline
    Senior Member
     
    Join Date: Sep 2000
    Location: FL
    Posts: 1,278
    sotoasty is a name known to all (1000+) sotoasty is a name known to all (1000+) sotoasty is a name known to all (1000+) sotoasty is a name known to all (1000+) sotoasty is a name known to all (1000+) sotoasty is a name known to all (1000+) sotoasty is a name known to all (1000+) sotoasty is a name known to all (1000+) sotoasty is a name known to all (1000+)
    Re: How do I open a router port?

    Quote:
    Originally Posted by Mutant_Fruit View Post
    Erm... see both of my previous posts...

    This is not possible, but there are standardised ways of doing this.
    Although it can be possible, you can not count on a router either implementing these features, or having them turned on. My particular router has UPnP, but is turned off by default. Each particular router is going to be different, so he has to start there. And for the most part, the easiest thing to do for computers communicating, is going to be open a port on the router, so the 2 computers can talk. Then, as in my post above, you will also need to check the Firewall, and the AntiVirus/Security Software to make sure those aren't stopping the communication.
    Reply With Quote
      #11    
    Old August 31st, 2009, 04:00 PM
    Mutant_Fruit Mutant_Fruit is offline
    Senior Member
     
    Join Date: May 2007
    Posts: 1,233
    Mutant_Fruit is a splendid one to behold (750+) Mutant_Fruit is a splendid one to behold (750+) Mutant_Fruit is a splendid one to behold (750+) Mutant_Fruit is a splendid one to behold (750+) Mutant_Fruit is a splendid one to behold (750+) Mutant_Fruit is a splendid one to behold (750+) Mutant_Fruit is a splendid one to behold (750+)
    Re: How do I open a router port?

    Quote:
    Originally Posted by sotoasty View Post
    Although it can be possible, you can not count on a router either implementing these features or having them turned on.
    Pretty much every router supports one of these protocols. The only ones which wouldn't would be extremely ancient ones, which I really doubt anyone still uses.

    Quote:
    Each particular router is going to be different, so he has to start there.
    Which is exactly why he should rely on upnp. This is why it was invented in the first place. If upnp is disabled, the user should be prompted to activate it. That would be much simpler for the user than trying to forward ports by hand, which can be quite a complex procedure. For example if they have a standard setup, their computer will get a dynamic IP. It's quite possible that this IP will be different every time they restart the router which means they'll have to reset the port mapping every time. If they can't or won't activate it, then they'll just have to forward the ports manually. There's no other way to automate port forwarding.

    Quote:
    Then, as in my post above, you will also need to check the Firewall, and the AntiVirus/Security Software to make sure those aren't stopping the communication.
    That's both operating system and user dependent and will have to be done regardless of whether you automatically or manually forward a port. Cutting manual port forwarding out of the loop will allow things to work automatically for quite a lot of people so why not do it.

    Anyway, the question has been answered and there isn't really much else of use which can be added to the topic. Hopefully the above makes sense.
    __________________
    www.monotorrent.com For all your .NET bittorrent needs

    NOTE: My code snippets are just snippets. They demonstrate an idea which can be adapted by you to solve your problem. They are not 100% complete and fully functional solutions equipped with error handling.

    Last edited by Mutant_Fruit; August 31st, 2009 at 04:03 PM.
    Reply With Quote
      #12    
    Old September 2nd, 2009, 12:56 AM
    Gbates Gbates is offline
    Junior Member
     
    Join Date: Aug 2009
    Posts: 19
    Gbates is an unknown quantity at this point (<10)
    Re: How do I open a router port?

    So how does MSN, ICQ, SKYPE connects between computers even if they are connected to a router?
    Reply With Quote
      #13    
    Old September 2nd, 2009, 12:57 PM
    Gbates Gbates is offline
    Junior Member
     
    Join Date: Aug 2009
    Posts: 19
    Gbates is an unknown quantity at this point (<10)
    Re: How do I open a router port?

    I will be more than glad of you will answer my question abobe (how do ICQ,MSN,SKYE can connect 2 computers even if they are connected to a router)..
    Reply With Quote
      #14    
    Old September 2nd, 2009, 01:09 PM
    monalin monalin is offline
    Member
     
    Join Date: Jul 2006
    Posts: 297
    monalin has a spectacular aura about (125+) monalin has a spectacular aura about (125+)
    Re: How do I open a router port?

    MSN and ICQ work differently than SKYPE. MSN and ICQ are both Client-Server applications meaning they don't connect each computer together to chat. They have a server that all the clients connect to and the server distributes the messages to the proper computer. SKYPE on the other hand is a Peer-to-Peer application which means that when you call someone on skype you host the call on your own computer.

    The point is regardless of how you connect two computers the router shouldn't inter fear with the exception of maybe opening a port aside from that the router does nothing but filter the IP packets. If the port is open you don't need to touch the router in code. If it isn't open then you need to manually open it through the router.
    Reply With Quote
      #15    
    Old September 2nd, 2009, 05:57 PM
    Mutant_Fruit Mutant_Fruit is offline
    Senior Member
     
    Join Date: May 2007
    Posts: 1,233
    Mutant_Fruit is a splendid one to behold (750+) Mutant_Fruit is a splendid one to behold (750+) Mutant_Fruit is a splendid one to behold (750+) Mutant_Fruit is a splendid one to behold (750+) Mutant_Fruit is a splendid one to behold (750+) Mutant_Fruit is a splendid one to behold (750+) Mutant_Fruit is a splendid one to behold (750+)
    Re: How do I open a router port?

    Both MSN[0] and Skype [1] use uPnP to open ports in the router if it is available. I've attached a screenshot of the ports they've opened. As you can see i have a dynamic IP uPnP is what allows you to get fast file transfers in msn, there is no other way to configure the port it uses.

    [0] http://url.ie/2d5f
    [1] http://share.skype.com/sites/garage/...windows_b.html
    Attached Images
     
    __________________
    www.monotorrent.com For all your .NET bittorrent needs

    NOTE: My code snippets are just snippets. They demonstrate an idea which can be adapted by you to solve your problem. They are not 100% complete and fully functional solutions equipped with error handling.
    Reply With Quote
    Reply

    Bookmarks
    Go Back   CodeGuru Forums > .NET Programming > C-Sharp Programming


    Thread Tools Search this Thread
    Search this Thread:

    Advanced Search
    Display Modes Rate This Thread
    Rate This Thread:

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off
    Forum Jump


    All times are GMT -5. The time now is 10:54 AM.



    Acceptable Use Policy


    The Network for Technology Professionals

    Search:

    About Internet.com

    Legal Notices, Licensing, Permissions, Privacy Policy.
    Advertise | Newsletters | E-mail Offers


    Powered by vBulletin® Version 3.7.3
    Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.