Thread: Cross Network communication using Winsock2?

  1. #1
    Registered User
    Join Date
    May 2005
    Posts
    17

    Unhappy Cross Network communication using Winsock2?

    Hi

    Is it possible for 2 machines on comletely different networks communicate with each other using Winsock2?

    Regards
    dp_76

  2. #2
    Registered User
    Join Date
    Jan 2005
    Posts
    847
    The networks would have to be connected in someway.

  3. #3
    Registered User
    Join Date
    May 2005
    Posts
    17
    Both the machines for sure are connected to internet.

    waiting for suggestions
    dp_76

  4. #4
    Registered User
    Join Date
    Jan 2005
    Posts
    847
    Yes it is possible however at least one machine (the server) needs to be able to accept incoming connection from the internet. Either the server machine has been assigned an internet IP address as well as it's local network IP address or the network router needs to be configured to foreward a specific internet port to a port on the local network machine, then the connecting machine connects to the externally known IP and the router forewards the connection to the local IP of the machine.

  5. #5
    Registered User
    Join Date
    May 2005
    Posts
    17
    Hi
    Thanx for ur suggestions sir.

    The client is on a machine in my local network.
    The server application is on a different machine in some other network.
    The server application machine has an ip address & the client is aware of server's ip.
    Both client & server r connected to internet.
    Can they communicate using winsock2.

    Y i ask this is because i have developed a client server application using mfc & winsock2.

    When client & server run on different mchines within the same network, the communicate & do the needfull.
    But when in different networks, they fail to connect.

    plz help
    Waiting for suggestions.
    dp_76

  6. #6
    Registered User
    Join Date
    Jan 2005
    Posts
    847
    Quote Originally Posted by dp_76
    Hi
    The server application is on a different machine in some other network.
    The server application machine has an ip address & the client is aware of server's ip.
    If the server's IP that the client is aware of is in one of these ranges
    10.0.0.0 - 10.255.255.255
    172.16.0.0 - 172.31.255.255
    192.168.0.0 - 192.168.255.255
    Then that is it's local network IP address which is only valid on the same network.
    YOu need it's externally known IP address and to make sure the networks's router is forewarding connections as mentioned above.
    This is because there can be many hosts on a network and only one external IP address so the router needs to be explicity configured to foreward connection to a certain IP address. If you're not the administrator of either router then you won't be able to get them to communicate directly, however both client and server could connect to a server on the internet which they can both access to communicate.

  7. #7
    Registered User
    Join Date
    May 2005
    Posts
    17
    Hi
    Thanx for ur suggestions.

    They are really helpful

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Unkown Hang
    By Bladactania in forum C Programming
    Replies: 31
    Last Post: 04-22-2009, 09:33 AM
  2. Minimax, URGENT :(
    By Dark-MX0Z in forum C++ Programming
    Replies: 6
    Last Post: 11-14-2007, 06:29 AM
  3. 3D Network Analysis Tool
    By durban in forum Projects and Job Recruitment
    Replies: 1
    Last Post: 11-08-2005, 06:33 PM
  4. Need help with easy Network setup
    By the dead tree in forum Tech Board
    Replies: 9
    Last Post: 04-08-2005, 07:44 PM
  5. WinXP Network Connections pop-up
    By DavidP in forum Tech Board
    Replies: 1
    Last Post: 10-02-2002, 05:36 PM