ffset and length are optional but both <em>must</em> be set if either are used.
They are supported only when the first argument is a <code>Buffer</code>, a <code>TypedArray</code>,
or a <code>DataView</code>.</p>
<p>This method throws <a href="errors.html#errors_err_socket_bad_port"><code>ERR_SOCKET_BAD_PORT</code></a> if called on an unbound socket.</p>
<p>Example of sending a UDP packet to a port on <code>localhost</code>;</p>
<pre><code class="language-js"><span class="hljs-keyword">const</span> dgram = 