Extending networking/socket programming functionality of a qml project
-
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 -
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?
-
Nobody suggested that you install a DNS server. You need to get an address from example from noip or another service.
-
Nobody suggested that you install a DNS server. You need to get an address from example from noip or another service.
-
@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. -
@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. -
@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).
-
@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).
-
@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?@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. -
@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.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 ServicesI signed up and then went for adding a hostname but for the domain there're many options, as follows:
- Is what I've done so far right, please?
- What to choose for the domain, please?
-
- yes
- that's up to you.
-
- yes
So I need to go through all those 7 steps. Right?
- 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?
-
-
except the router step, that part you will need to do for your device.
-
the subdomain really does not matter that much, hence your choice. The default shall be fine.
-
-
-
except the router step, that part you will need to do for your device.
-
the subdomain really does not matter that much, hence your choice. The default shall be fine.
@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. -
-
The device that runs the server shall update the record at noip to point to its own address.
-
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!
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?
-
- Yes
- 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.
- It's the IP address of the device that runs your server application.
-
- Yes
- 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.
- It's the IP address of the device that runs your server application.
As I already wrote, it's going to be the role of your server application to update the record at noip.
I suppose it's a two-step task:
1- First the server (using its code) shall connect to noip. A simple connection piece of code (which is also used in my app) is:
tcpSocket->connectToHost(ip, port.toInt());
So presumably an IP (and a port) is/are required for a connection. Therefore how should that server connect to noip, please?2- The server then needs to update a record (of my hostname there, probably) so that the IP the server is running on will be set there. How does that update take place? I have no info of! :|
You client will have the host name either hardcoded or as something that can be configured at runtime.
3- OK, if we aim at hard coding, using what code should the client get access to the hostname, please?
-
Are you realizing that your design is getting really complicated for not much benefit ?
- you do realize that as soon as a mobile device (or any networked device for that matter) can access internet it already has an IP address ?
- check with noip for a client library to do that.
- Do you know what hardcoding a value means ? Also as a said, you can configure that value in a setting.
-
Are you realizing that your design is getting really complicated for not much benefit ?
- you do realize that as soon as a mobile device (or any networked device for that matter) can access internet it already has an IP address ?
- check with noip for a client library to do that.
- Do you know what hardcoding a value means ? Also as a said, you can configure that value in a setting.
Yes, I'm seeing it. I need to wait two days for a text reply.
But still have liked not to give up since all the stuff are completely new for me and are interesting.- you do realize that as soon as a mobile device (or any networked device for that matter) can access internet it already has an IP address ?
Yes, the client app itself has an IP address but the destination it wants to connect to (the noip site) should supposedly also have an IP address. I think you don't mean to use the IP address dedicated to the website for that connection!
- check with noip for a client library to do that.
Will try that.
- Do you know what hardcoding a value means ?
I think it means writing code. Know nothing more about that.
Also as a said, you can configure that value in a setting.
Setting? Setting of where?