Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. TCP/IP connection not possible throught internet to other computer

TCP/IP connection not possible throught internet to other computer

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
7 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    arr cpp
    wrote on last edited by
    #1

    I'v tried to connect two computers using sockets... it works between computers in the same LAN, and between computers in the same internet subnet. But, when i try to connect to computers that are far away in the internet(at another city), the connection fails; it simply doesn't reach the listening computer. I've heared about public and private IPs is this the problem?? How may I fix it up?? Thanks in advance!!

    M 1 Reply Last reply
    0
    • A arr cpp

      I'v tried to connect two computers using sockets... it works between computers in the same LAN, and between computers in the same internet subnet. But, when i try to connect to computers that are far away in the internet(at another city), the connection fails; it simply doesn't reach the listening computer. I've heared about public and private IPs is this the problem?? How may I fix it up?? Thanks in advance!!

      M Offline
      M Offline
      mmavipc
      wrote on last edited by
      #2

      if the remote computer is connected to a router you will have to setup port forwarding on the router. E.G. something that wont work: ---------------------------- Remote computer(client) | Router(without port forwarding) | Remote computer(server) ----------------------------- something that will work: ----------------------------- Remote computer(client) | Router(with port forwarding) | Remote computer(server) -----------------------------

      A 1 Reply Last reply
      0
      • M mmavipc

        if the remote computer is connected to a router you will have to setup port forwarding on the router. E.G. something that wont work: ---------------------------- Remote computer(client) | Router(without port forwarding) | Remote computer(server) ----------------------------- something that will work: ----------------------------- Remote computer(client) | Router(with port forwarding) | Remote computer(server) -----------------------------

        A Offline
        A Offline
        arr cpp
        wrote on last edited by
        #3

        well, the connection works through the router cause i can connect to other computers in the internet that are in the same city... connection doesnt work connecting to computers in another city... may it be a problem between nodes?? my public ip (i get it from www.whatismyip.com[^] ) is the same as all other computers i use in my connection so i cannot use this ip because i dont connect to any concrete computer. i dont know what to do...

        M 1 Reply Last reply
        0
        • A arr cpp

          well, the connection works through the router cause i can connect to other computers in the internet that are in the same city... connection doesnt work connecting to computers in another city... may it be a problem between nodes?? my public ip (i get it from www.whatismyip.com[^] ) is the same as all other computers i use in my connection so i cannot use this ip because i dont connect to any concrete computer. i dont know what to do...

          M Offline
          M Offline
          Mark Salsbery
          wrote on last edited by
          #4

          arr2arr1arr wrote:

          my public ip (i get it from www.whatismyip.com[^] ) is the same as all other computers i use in my connection

          You mean all the computers on your LAN have the same public IP? That's normal. The problem is on the remote end. You need the public IP of the remote to connect to, and if the remote is on a LAN behind a gateway/router then the remote network needs to be configured to forward connection requests to the appropriate computer on the LAN. This is usually accomplished by port forwarding. Remember an address consists of an IP address and a port number. The port number is used to identify the application associated with the socket.

          "If you can dodge a wrench, you can dodge a ball."

          A 1 Reply Last reply
          0
          • M Mark Salsbery

            arr2arr1arr wrote:

            my public ip (i get it from www.whatismyip.com[^] ) is the same as all other computers i use in my connection

            You mean all the computers on your LAN have the same public IP? That's normal. The problem is on the remote end. You need the public IP of the remote to connect to, and if the remote is on a LAN behind a gateway/router then the remote network needs to be configured to forward connection requests to the appropriate computer on the LAN. This is usually accomplished by port forwarding. Remember an address consists of an IP address and a port number. The port number is used to identify the application associated with the socket.

            "If you can dodge a wrench, you can dodge a ball."

            A Offline
            A Offline
            arr cpp
            wrote on last edited by
            #5

            Ok, my computer is the "remote computer" that is listening for HTTP incoming connections. i have my public ip; i try to connect from other computer that is not behind the same gateway. how to allow forward connection requests to my computer on an internet gateway? (Could the problem be not in my router but in the internet gateway it connects to??)

            A 1 Reply Last reply
            0
            • A arr cpp

              Ok, my computer is the "remote computer" that is listening for HTTP incoming connections. i have my public ip; i try to connect from other computer that is not behind the same gateway. how to allow forward connection requests to my computer on an internet gateway? (Could the problem be not in my router but in the internet gateway it connects to??)

              A Offline
              A Offline
              arr cpp
              wrote on last edited by
              #6

              arr2arr1arr wrote:

              how to allow forward connection requests to my computer on an internet gateway?

              Thanks to all!! Now i know how it is done!! Just get into router options in "http://(RouterIpAddress)/"

              M 1 Reply Last reply
              0
              • A arr cpp

                arr2arr1arr wrote:

                how to allow forward connection requests to my computer on an internet gateway?

                Thanks to all!! Now i know how it is done!! Just get into router options in "http://(RouterIpAddress)/"

                M Offline
                M Offline
                Mark Salsbery
                wrote on last edited by
                #7

                :)

                "If you can dodge a wrench, you can dodge a ball."

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups