title: Keeping socket open for UDP?
body: <p>Using TCP, the workflow for sending the data is following:</p>
  
  <pre><code>- open socket()
  - write(data1)
  - write(data2)
  - write ... data n
  - close(socket)
  </code></pre>
  
  <p>But how is it with UDP? Do we keep the socket open? Or do we open the socket every time the data is ready? What is the best practice for that?</p>
  
  <pre><code>- open socket();
  - write(data1);
  - close(socket);
  
  
  - open socket();
  - write(data2);
  - close(socket);
  </code></pre>