g">'udp4'</span>);
client.send([buf1, buf2], <span class="hljs-number">41234</span>, (err) => {
  client.close();
});</code></pre>
<p>Sending multiple buffers might be faster or slower depending on the
application and operating system. Run benchmarks to
determine the optimal strategy on a case-by-case basis. Generally speaking,
however, sending multiple buffers is faster.</p>
<p>Example of sending a UDP packet using a socket connected to a port on
<code>localhost</code>:</p>
<pre><code class="language-js"><