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. How to get an ip address and send a frame to this address?
Forum Updated to NodeBB v4.3 + New Features

How to get an ip address and send a frame to this address?

Scheduled Pinned Locked Moved Unsolved General and Desktop
11 Posts 5 Posters 685 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.
  • R Offline
    R Offline
    Raphawel
    wrote on last edited by
    #1

    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.

    Christian EhrlicherC C 2 Replies Last reply
    0
    • R Raphawel

      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.

      Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @Raphawel said in How to get an ip address and send a frame to this address?:

      and send it a frame.

      How? UDP? TCP?

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      1 Reply Last reply
      0
      • R Offline
        R Offline
        Raphawel
        wrote on last edited by
        #3

        This is TCP.

        Kent-DorfmanK 1 Reply Last reply
        0
        • Christian EhrlicherC Offline
          Christian EhrlicherC Offline
          Christian Ehrlicher
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Then use QTcpSocket to send the data.

          Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
          Visit the Qt Academy at https://academy.qt.io/catalog

          1 Reply Last reply
          2
          • R Offline
            R Offline
            Raphawel
            wrote on last edited by
            #5

            Ok thanks, and I guess you have to use QAbstractSocket with QTcpSocket ?

            Christian EhrlicherC 1 Reply Last reply
            0
            • R Raphawel

              Ok thanks, and I guess you have to use QAbstractSocket with QTcpSocket ?

              Christian EhrlicherC Offline
              Christian EhrlicherC Offline
              Christian Ehrlicher
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @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.

              Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
              Visit the Qt Academy at https://academy.qt.io/catalog

              1 Reply Last reply
              2
              • R Raphawel

                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.

                C Offline
                C Offline
                ChrisW67
                wrote on last edited by
                #7

                @Raphawel See
                Qt Examples and Demos, specifically Network Examples

                1 Reply Last reply
                1
                • R Raphawel

                  This is TCP.

                  Kent-DorfmanK Offline
                  Kent-DorfmanK Offline
                  Kent-Dorfman
                  wrote on last edited by
                  #8

                  @Raphawel

                  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?"

                  R 1 Reply Last reply
                  2
                  • Kent-DorfmanK Kent-Dorfman

                    @Raphawel

                    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?"

                    R Offline
                    R Offline
                    Raphawel
                    wrote on last edited by
                    #9

                    @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

                    jsulmJ Kent-DorfmanK 2 Replies Last reply
                    0
                    • R Raphawel

                      @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

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

                      @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.

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

                      1 Reply Last reply
                      1
                      • R Raphawel

                        @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-DorfmanK Offline
                        Kent-DorfmanK Offline
                        Kent-Dorfman
                        wrote on last edited by
                        #11

                        @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.

                        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