title: Are the send and receive methods of sf::UdpSocket threadsafe?
body: <p>I have a NetworkDevice class that runs an <code>std::thread</code> to queue all incoming packets. While doing this I also want to send Packets on the same <code>sf::UdpSocket</code>.
  I cant find any Information about though, about whether the send &amp; receive methods of <code>sf::UdpSocket</code> are threadsafe.</p>
  
  <p>The class looks something like that:</p>
  
  <pre><code>class NetworkDevice
  {
     std::thread m_Thread;
     std::mutex m_Mtx;
     bool isRunning;
     sf::UdpSocket m_Socket;
     std::deque&lt;std::pair&lt;Packet, Connection&gt;&gt; m_Packets;
  
     void listenUdp()
     {
        while(isRunning)
        {
        // Do some stuff
        m_Socket.receive(packet, remoteAddress, remotePort);
        m_Mtx.lock();
        m_Packets.push_back(std::make_pair(packet, Connection(remoteAddress, remotePort)));
        m_Mtx.unlock();
        // Do some stuff
        }
     }
  
     void startThread();
     {
        isRunning = true;
        m_Thread = std::thread([this](){listenUdp();});
     }
  
     void sendPacket(Packet&amp; packet, Connection&amp; connection);
     {
        m_Socket.send(packet, connection.address, connection.port);
     }
  
     void update(std::deque&lt;std::pair&lt;Packet, Connection&gt;&gt;&amp; packets)
     {
        m_Mtx.lock();
        packets = m_Packets;
        m_Mtx.unlock();
     }
  };
  </code></pre>
  
  <p><strong>Will I have any unexpected effects when the <code>sf::UdpSocket::send</code> and <code>sf::UdpSocket::receive</code> methods are working simultaneouly?</strong></p>
  
  <p>And If so should I rather:</p>
  
  <ol>
  <li>Have a mutex that gets locked before executing above named methods?</li>
  <li>Have a second socket just for sending?</li>
  </ol>