Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Extending networking/socket programming functionality of a qml project
Forum Updated to NodeBB v4.3 + New Features

Extending networking/socket programming functionality of a qml project

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
92 Posts 5 Posters 18.4k Views 2 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.
  • SGaistS Offline
    SGaistS Offline
    SGaist
    Lifetime Qt Champion
    wrote on last edited by
    #10

    Here is the thing: network programming is not simple as soon as you put internet in the mix.

    Hence, taking the time to study more complexe but detailed examples will help you faster than trying to make things work in a complexe setup. The chat is a good example: simple implementation for local networks, it requires more bricks when you start making a service that shall work across networks on different devices.

    Interested in AI ? www.idiap.ch
    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

    Q 1 Reply Last reply
    1
    • SGaistS SGaist

      Here is the thing: network programming is not simple as soon as you put internet in the mix.

      Hence, taking the time to study more complexe but detailed examples will help you faster than trying to make things work in a complexe setup. The chat is a good example: simple implementation for local networks, it requires more bricks when you start making a service that shall work across networks on different devices.

      Q Offline
      Q Offline
      qcoderpro
      wrote on last edited by
      #11

      @SGaist

      Here is the thing: network programming is not simple as soon as you put internet in the mix.
      Hence, taking the time to study more complexe but detailed examples will help you faster than trying to make things work in a complexe setup. The chat is a good example: simple implementation for local networks, it requires more bricks when you start making a service that shall work across networks on different devices.

      Yeah, sure. I understand and will certainly study that chat example in near future, but for now I just like to extend my two projects so that they can work through global Internet.

      Will you answer the questions I asked above, please? They're important for me.

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #12

        Static address is not required if you have a DNS resolvable name.

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        Q 1 Reply Last reply
        2
        • VRoninV Offline
          VRoninV Offline
          VRonin
          wrote on last edited by
          #13

          Your problem is not an application one (if it works over LAN it means that you programmed it correctly), it’s an infrastructure one.
          If you don’t have one of the two devices set up to accept incoming connections and with a way to know what IP address to connect to (via either static ip or registering with a DNS) then you can’t do it.
          Neither of these conditions, however, depend on the application code, it’s just device setup

          "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
          ~Napoleon Bonaparte

          On a crusade to banish setIndexWidget() from the holy land of Qt

          1 Reply Last reply
          2
          • SGaistS SGaist

            Static address is not required if you have a DNS resolvable name.

            Q Offline
            Q Offline
            qcoderpro
            wrote on last edited by
            #14

            @SGaist

            Static address is not required if you have a DNS resolvable name.

            Although I've forgotten most of the things from university lessons (years ago) but yet can recall that a DNS works much like a phone book by managing the mapping between names and numbers. Do you mean that I need to setup a DNS resolvable name? Will you recommend a tutorial on this please?

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #15

              Nobody suggested that you install a DNS server. You need to get an address from example from noip or another service.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              Q 1 Reply Last reply
              1
              • SGaistS SGaist

                Nobody suggested that you install a DNS server. You need to get an address from example from noip or another service.

                Q Offline
                Q Offline
                qcoderpro
                wrote on last edited by qcoderpro
                #16

                @SGaist
                Aha, you mean to get an IP address from noip.com for instance, or another website like that.
                But how that IP address will work on my projects, please?

                jsulmJ 1 Reply Last reply
                0
                • Q qcoderpro

                  @SGaist
                  Aha, you mean to get an IP address from noip.com for instance, or another website like that.
                  But how that IP address will work on my projects, please?

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

                  @qcoderpro said in Extending networking/socket programming functionality of a qml project:

                  But how that IP address will work on my projects, please?

                  Your device will get the IP at runtime using DNS.
                  If you access www..google..com you also do not enter an IP, right? But in the background your machine gets the IP for www..google..com via DNS.

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

                  Q 1 Reply Last reply
                  1
                  • jsulmJ jsulm

                    @qcoderpro said in Extending networking/socket programming functionality of a qml project:

                    But how that IP address will work on my projects, please?

                    Your device will get the IP at runtime using DNS.
                    If you access www..google..com you also do not enter an IP, right? But in the background your machine gets the IP for www..google..com via DNS.

                    Q Offline
                    Q Offline
                    qcoderpro
                    wrote on last edited by
                    #18

                    @jsulm
                    I mean, is the story this way?
                    When both projects are run, the server will get the IP address (provided by noip.com). The client also has that address (in its code) so it connects to it. Then they can exchanges messages.
                    Right?

                    If so, how about the port number!? Don't we need it?

                    jsulmJ 1 Reply Last reply
                    0
                    • Q qcoderpro

                      @jsulm
                      I mean, is the story this way?
                      When both projects are run, the server will get the IP address (provided by noip.com). The client also has that address (in its code) so it connects to it. Then they can exchanges messages.
                      Right?

                      If so, how about the port number!? Don't we need it?

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

                      @qcoderpro said in Extending networking/socket programming functionality of a qml project:

                      The client also has that address (in its code) so it connects to it

                      Do you mean IP address? No, client also has to get the IP first.

                      "If so, how about the port number!?" - port number can be fixed (like 8080 for HTTP).

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

                      Q 1 Reply Last reply
                      1
                      • jsulmJ jsulm

                        @qcoderpro said in Extending networking/socket programming functionality of a qml project:

                        The client also has that address (in its code) so it connects to it

                        Do you mean IP address? No, client also has to get the IP first.

                        "If so, how about the port number!?" - port number can be fixed (like 8080 for HTTP).

                        Q Offline
                        Q Offline
                        qcoderpro
                        wrote on last edited by
                        #20

                        @jsulm
                        OK so both projects need to get the IP address at runtime and since the port is set to 8080 (as you said), they can connect and start exchanging messages. Right?

                        jsulmJ 1 Reply Last reply
                        0
                        • Q qcoderpro

                          @jsulm
                          OK so both projects need to get the IP address at runtime and since the port is set to 8080 (as you said), they can connect and start exchanging messages. Right?

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

                          @qcoderpro said in Extending networking/socket programming functionality of a qml project:

                          as you said

                          I did not. It was just an example.
                          "they can connect and start exchanging messages" - if they can get the IP then yes.

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

                          Q 1 Reply Last reply
                          1
                          • jsulmJ jsulm

                            @qcoderpro said in Extending networking/socket programming functionality of a qml project:

                            as you said

                            I did not. It was just an example.
                            "they can connect and start exchanging messages" - if they can get the IP then yes.

                            Q Offline
                            Q Offline
                            qcoderpro
                            wrote on last edited by
                            #22

                            @jsulm

                            OK I visited the page for noip.com and read a number of services they offer, some of them are free, but limited, as expected.
                            Are the steps to get the IP needed for the projects to work, as below, please?

                            1: Create an Account.
                            2: Confirm Your Account.
                            3: Log In to Your Account.
                            4: Add a Host or Domain to Your Account.
                            5: Making Your Host Dynamic.
                            6: Configure Your Router.
                            7: Run Your Services

                            I signed up and then went for adding a hostname but for the domain there're many options, as follows:
                            qweqw.png

                            1. Is what I've done so far right, please?
                            2. What to choose for the domain, please?
                            1 Reply Last reply
                            0
                            • SGaistS Offline
                              SGaistS Offline
                              SGaist
                              Lifetime Qt Champion
                              wrote on last edited by
                              #23
                              1. yes
                              2. that's up to you.

                              Interested in AI ? www.idiap.ch
                              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                              Q 1 Reply Last reply
                              1
                              • SGaistS SGaist
                                1. yes
                                2. that's up to you.
                                Q Offline
                                Q Offline
                                qcoderpro
                                wrote on last edited by
                                #24

                                @SGaist

                                1. yes

                                So I need to go through all those 7 steps. Right?

                                1. that's up to you.

                                I've no idea what to choose and for what, ect. since I'm new in networking and my purpose for using noip service ( (for now)) is just to use it for my two QML projects mentioned above. Which domain do you suggest, please?

                                1 Reply Last reply
                                0
                                • SGaistS Offline
                                  SGaistS Offline
                                  SGaist
                                  Lifetime Qt Champion
                                  wrote on last edited by
                                  #25
                                  1. except the router step, that part you will need to do for your device.

                                  2. the subdomain really does not matter that much, hence your choice. The default shall be fine.

                                  Interested in AI ? www.idiap.ch
                                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                                  Q 1 Reply Last reply
                                  1
                                  • SGaistS SGaist
                                    1. except the router step, that part you will need to do for your device.

                                    2. the subdomain really does not matter that much, hence your choice. The default shall be fine.

                                    Q Offline
                                    Q Offline
                                    qcoderpro
                                    wrote on last edited by
                                    #26

                                    @SGaist
                                    I created the hostname with the default domain.
                                    1- But is this hostname the IP address we were aiming to get from noip!?

                                    For the step 5, I installed their app on my Windows and it takes my IP and point it to the hostname so that the hostname works statically as though I'm having a static IP.
                                    But my two apps should not rely on my machine and IP address. They may be run by two different people from different countries.
                                    What I need is that, that hostname acts like a bridge to connect the apps independently of the place they're running from.

                                    1 Reply Last reply
                                    0
                                    • SGaistS Offline
                                      SGaistS Offline
                                      SGaist
                                      Lifetime Qt Champion
                                      wrote on last edited by
                                      #27

                                      The device that runs the server shall update the record at noip to point to its own address.

                                      Interested in AI ? www.idiap.ch
                                      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                                      1 Reply Last reply
                                      1
                                      • Q Offline
                                        Q Offline
                                        qcoderpro
                                        wrote on last edited by
                                        #28

                                        @SGaist

                                        The device that runs the server shall update the record at noip to point to its own address.

                                        1- So the server, using its code, should update the record at noip to point to its own address, and then client should connect to the hostname at noip. Hence this way both apps can establish a connection. Right?

                                        2- But for the server to get access to noip and update its record and the client to get connected to the address provided by noip, we need an IP address. Right? I only see my PC's IP address and my hostname on noip!
                                        das123.PNG

                                        3- Where's that IP address that will do the real job of the connection between the apps? I assume it should be my hostname! Wrong, please?

                                        1 Reply Last reply
                                        0
                                        • SGaistS Offline
                                          SGaistS Offline
                                          SGaist
                                          Lifetime Qt Champion
                                          wrote on last edited by
                                          #29
                                          1. Yes
                                          2. As I already wrote, it's going to be the role of your server application to update the record at noip. You client will have the host name either hardcoded or as something that can be configured at runtime.
                                          3. It's the IP address of the device that runs your server application.

                                          Interested in AI ? www.idiap.ch
                                          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                                          Q 1 Reply Last reply
                                          1

                                          • Login

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