title: Is it ok to use a QUdpSocket in different threads?
body: <p>I want to a QUdpSocket but read/write data in different threads like this:</p>
  
  <pre><code>void UDPLink::writeBytes(const char* data, qint64 size)
  {
      // Broadcast to all connected systems
      for (int h = 0; h &lt; hosts.size(); h++)
      {
          QHostAddress currentHost = hosts.at(h);
          quint16 currentPort = ports.at(h);
          socket-&gt;writeDatagram(data, size, currentHost, currentPort);
      }
  }
  
  void UDPLink::readBytes()
  {
      while (socket-&gt;hasPendingDatagrams())
      {
          QByteArray datagram;
          datagram.resize(socket-&gt;pendingDatagramSize());
  
          QHostAddress sender;
          quint16 senderPort;
          socket-&gt;readDatagram(datagram.data(), datagram.size(), &amp;sender, &amp;senderPort);
  
          // FIXME TODO Check if this method is better than retrieving the data by individual processes
          emit bytesReceived(this, datagram);
       }
  }
  </code></pre>
  
  <p>The <code>readBytes()</code> is triggered the socket's <code>readyRead</code> signal.
  However the writeBytes is in a worker thread, and the readBytes is in the main thread. Is this Ok?</p>