How to get an ip address and send a frame to this address?
-
Hello,
For a project I have to get an IP address of an object connected on the network and send it a frame.Do you know how to do it ?
Are there any topics that talk about this subject?I know I have to use the QTNetwork library, but there are so many sub-libraries that I'm lost in what to use.
I thank you in advance for your answer.
-
Hello,
For a project I have to get an IP address of an object connected on the network and send it a frame.Do you know how to do it ?
Are there any topics that talk about this subject?I know I have to use the QTNetwork library, but there are so many sub-libraries that I'm lost in what to use.
I thank you in advance for your answer.
@Raphawel said in How to get an ip address and send a frame to this address?:
and send it a frame.
-
Then use QTcpSocket to send the data.
-
@Raphawel said in How to get an ip address and send a frame to this address?:
I guess you have to use QAbstractSocket with QTcpSocket ?
What does this mean? QTcpSocket dervies from QAbstractSocket, nothing more.
-
Hello,
For a project I have to get an IP address of an object connected on the network and send it a frame.Do you know how to do it ?
Are there any topics that talk about this subject?I know I have to use the QTNetwork library, but there are so many sub-libraries that I'm lost in what to use.
I thank you in advance for your answer.
@Raphawel See
Qt Examples and Demos, specifically Network Examples -
TCP?
Why? What justifies that requirement?
What does "get an ip address" mean? That statement makes my head spin. Get it from where?
and what is a "frame?"
-
TCP?
Why? What justifies that requirement?
What does "get an ip address" mean? That statement makes my head spin. Get it from where?
and what is a "frame?"
@Kent-Dorfman Sorry for the late answer.
In fact I plan to create an ihm to automate a connected object on the network. For the moment, I just have to turn it off and on.For that, I have to send a "command" on its IP address which will allow to turn off or to turn on.
So for me I have to connect to this IP address first and send a command via TCP.Why TCP ? Because TCP allows to connect and exchange data between objects connected on the same network
-
@Kent-Dorfman Sorry for the late answer.
In fact I plan to create an ihm to automate a connected object on the network. For the moment, I just have to turn it off and on.For that, I have to send a "command" on its IP address which will allow to turn off or to turn on.
So for me I have to connect to this IP address first and send a command via TCP.Why TCP ? Because TCP allows to connect and exchange data between objects connected on the same network
@Raphawel What exactly is your problem? If you have the IP then connect to it using https://doc.qt.io/qt-6/qtcpsocket.html and send what ever you need to send to it.
-
@Kent-Dorfman Sorry for the late answer.
In fact I plan to create an ihm to automate a connected object on the network. For the moment, I just have to turn it off and on.For that, I have to send a "command" on its IP address which will allow to turn off or to turn on.
So for me I have to connect to this IP address first and send a command via TCP.Why TCP ? Because TCP allows to connect and exchange data between objects connected on the same network
@Raphawel said in How to get an ip address and send a frame to this address?:
Why TCP ? Because TCP allows to connect and exchange data between objects connected on the same network
TCP is a stream so understand that you are responsible for assembling a valid message from any number of reads that can return any possible fragment of a message.