Results 1 to 5 of 5

Thread: Creating Global Network

  1. #1
    Join Date
    Oct 2010
    Posts
    7
    Qt products
    Qt4
    Platforms
    Windows

    Default Creating Global Network

    Hi everybody,,


    i want to know that how we communicate Server <-> Client on global network, not local network. I have interested the network example in Qt that all examples work on local network.


    how I can connect client to server via global network(internet) like msn messenger.

    I want to make it with TCP socket programming.

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,420
    Thanks
    37
    Thanked 1,545 Times in 1,495 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Creating Global Network

    Fromt the application programming point of view there is no difference between local or remote machines, usage of the socket classes is always the same.
    The only thing that changes is the address you connect to.

    Cheers,
    _

  3. #3
    Join Date
    Oct 2010
    Posts
    7
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Creating Global Network

    Yes Programming interface is same local or global but

    which address i should connect?

    my local ip is 192.168.2.21 and port 12345, I can connect this address successully if target address and source address connected the same modem.

    if I try to connect my target other places(other city, home vs...) , ip address changing.

    on my line Source->Modem->Global Network->Modem->Target

    How I construct above struct?

    which way I should follow to make it?

  4. #4
    Join Date
    Mar 2008
    Location
    Kraków, Poland
    Posts
    1,477
    Thanked 274 Times in 269 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Creating Global Network

    You should connect to "external" IP under which a router is shown. The router should be configured forwarding calls to a specific internal address.

  5. #5
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,420
    Thanks
    37
    Thanked 1,545 Times in 1,495 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Creating Global Network

    Quote Originally Posted by hazad View Post
    which address i should connect?
    Whatever address the server is using that you are trying to connect to.
    Probably given as a domain name.

    There is really no difference from the programming point of view.

    Same thing for implementing a server.

    In both cases the network setup needs to be able to route packets from one machine to the other and back.

    All handled by the operating system, really nothing the application developer has to worry about.

    Cheers,
    _

Similar Threads

  1. creating a QWidget in the global space
    By wambagilles in forum Qt Programming
    Replies: 4
    Last Post: 8th May 2011, 18:54
  2. how to use a global vars in QT?
    By wter27 in forum Qt Programming
    Replies: 5
    Last Post: 21st January 2011, 09:26
  3. global variable
    By Shuchi Agrawal in forum General Programming
    Replies: 10
    Last Post: 15th February 2007, 04:19
  4. Creating a global array in my code???
    By therealjag in forum General Programming
    Replies: 5
    Last Post: 13th March 2006, 11:13
  5. creating a global instance
    By skatakam in forum General Programming
    Replies: 6
    Last Post: 24th February 2006, 16:26

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.