Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Connect to non-local IP or domain name
Forum Updated to NodeBB v4.3 + New Features

Connect to non-local IP or domain name

Scheduled Pinned Locked Moved Solved General and Desktop
13 Posts 4 Posters 2.7k 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.
  • KillerSmathK Offline
    KillerSmathK Offline
    KillerSmath
    wrote on last edited by
    #4

    @isan

    The network modules works with intra and extra network acess. But the responsable to forward your connection if necessary is the gateway of your network.

    A little resume of how network communication works:

    If the IP A and B are in the same network, A will send directly the packet to B because they are in the same network.
    But if the IP A and B are in different network, A will send the packet to default gateway of network and the gateway will be the responsable to find the next route to send the packet to B and so on until the packet reaches the destination or be discarded.

    But the communation can be refused for n reasons:

    • The gateway don't know how forward the connection (next route)
    • The gateway can refuse connection for a specific ip of network
    • The firewall can deny the connetion, etc.

    So, notice that it is a infraestruture problem and not a software problem.

    @Computer Science Student - Brazil
    Web Developer and Researcher
    “Sometimes it’s the people no one imagines anything of who do the things that no one can imagine.” - Alan Turing

    1 Reply Last reply
    5
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #5

      On top of @KillerSmath good explanation, i can highly recommend to read some
      networking to have an overview of how it works.
      http://www.steves-internet-guide.com/basic-networking-course/

      I 1 Reply Last reply
      3
      • mrjjM mrjj

        On top of @KillerSmath good explanation, i can highly recommend to read some
        networking to have an overview of how it works.
        http://www.steves-internet-guide.com/basic-networking-course/

        I Offline
        I Offline
        isan
        wrote on last edited by
        #6

        @mrjj so whats difference between network and websockets module?
        for connect to web server or non-local IP should use witch one?

        mrjjM 1 Reply Last reply
        0
        • I isan

          @mrjj so whats difference between network and websockets module?
          for connect to web server or non-local IP should use witch one?

          mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by mrjj
          #7

          Hi
          Websockets is a protocol designed for 2 ways interaction with
          web servers.
          Where as the network classes are more generic/broad to talk to any kind of
          IP device.

          To talk to an non local database server, you would still use the SQL classes.
          It really dont matter if local or on global scrope. Still works the same except
          there will be firewall in front if outside.
          Often if you buy the database access as service, its already set up to allow connections.
          If you own server. you need to make it possible.

          I 1 Reply Last reply
          3
          • mrjjM mrjj

            Hi
            Websockets is a protocol designed for 2 ways interaction with
            web servers.
            Where as the network classes are more generic/broad to talk to any kind of
            IP device.

            To talk to an non local database server, you would still use the SQL classes.
            It really dont matter if local or on global scrope. Still works the same except
            there will be firewall in front if outside.
            Often if you buy the database access as service, its already set up to allow connections.
            If you own server. you need to make it possible.

            I Offline
            I Offline
            isan
            wrote on last edited by isan
            #8

            @mrjj So If I want to connect to web server , can I use network module?

            jsulmJ 1 Reply Last reply
            0
            • KillerSmathK Offline
              KillerSmathK Offline
              KillerSmath
              wrote on last edited by KillerSmath
              #9

              @isan
              If you are trying to connect to SqlServer database using tcp ip, you can find an explanation in the ODBC Qt Wiki:
              Open Connection using TCP/IP

              Remember: The firewall of your server needs to allow the connection by port or service or it will deny the connection.

              @Computer Science Student - Brazil
              Web Developer and Researcher
              “Sometimes it’s the people no one imagines anything of who do the things that no one can imagine.” - Alan Turing

              1 Reply Last reply
              3
              • I isan

                @mrjj So If I want to connect to web server , can I use network module?

                jsulmJ Offline
                jsulmJ Offline
                jsulm
                Lifetime Qt Champion
                wrote on last edited by
                #10

                @isan Above you wanted to connect to a SQL server, now to a web server. So, what do you really want to do?

                https://forum.qt.io/topic/113070/qt-code-of-conduct

                I 1 Reply Last reply
                2
                • jsulmJ jsulm

                  @isan Above you wanted to connect to a SQL server, now to a web server. So, what do you really want to do?

                  I Offline
                  I Offline
                  isan
                  wrote on last edited by
                  #11

                  @jsulm I Had two different question on first ,non-local IP can be anything

                  mrjjM 1 Reply Last reply
                  0
                  • I isan

                    @jsulm I Had two different question on first ,non-local IP can be anything

                    mrjjM Offline
                    mrjjM Offline
                    mrjj
                    Lifetime Qt Champion
                    wrote on last edited by
                    #12

                    @isan
                    Hi
                    Yes you can use the network module to talk to web server.
                    Here is sample that downloads a file
                    http://www.bogotobogo.com/Qt/Qt5_Downloading_Files_QNetworkAccessManager_QNetworkRequest.php

                    so rest depends on WHAT you want to do with the web server.

                    I 1 Reply Last reply
                    3
                    • mrjjM mrjj

                      @isan
                      Hi
                      Yes you can use the network module to talk to web server.
                      Here is sample that downloads a file
                      http://www.bogotobogo.com/Qt/Qt5_Downloading_Files_QNetworkAccessManager_QNetworkRequest.php

                      so rest depends on WHAT you want to do with the web server.

                      I Offline
                      I Offline
                      isan
                      wrote on last edited by
                      #13

                      @mrjj thank you so much

                      1 Reply Last reply
                      0

                      • Login

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups
                      • Search
                      • Get Qt Extensions
                      • Unsolved