title: How to write TCP send and receive code in QT using Timer
body: <p>In QT QML, I am using a Timer, every 1 second the system will send a Hex string to an IP Address and a port, and receive a Hex String as well. How can I achieve that? I check the web it look very complicated to me...</p>
  <pre><code>Item {
                  Timer {
                      interval: 1000; running: true; repeat: true
                      onTriggered: 
                         1.) send 00 00 00 00 00 06 01 02 00 01 00 01 to 192.168.2.200:501
                         2.)Receive 00 00 00 00 00 05 01 02 02 00 00(last 2 bytes 00=on, 01=off)
                         3.) change the status= on or off
                        
                  }
  
                  Text { id: time }
              }
  
          How to write simple code for 1 &amp; 2. And if I need to establish the connection first, if should be outside the onTriggered or inside the onTriggered?
  
          Really appreciate if someone can help me, at least give me a clue, may be my concept totally wrong...
  </code></pre>