blob: 250baf6befdf7bbf20f9b4380fafa7c574d53acc (
plain)
1
2
3
4
5
6
7
8
9
10
|
<h4 class="subsection">Testing Availability of Network Features</h4> <p>To test for the availability of a given network feature, use <code>featurep</code> like this: </p> <div class="example"> <pre class="example">(featurep 'make-network-process '(<var>keyword</var> <var>value</var>))
</pre>
</div> <p>The result of this form is <code>t</code> if it works to specify <var>keyword</var> with value <var>value</var> in <code>make-network-process</code>. Here are some of the <var>keyword</var>—<var>value</var> pairs you can test in this way. </p> <dl compact> <dt><code>(:nowait t)</code></dt> <dd><p>Non-<code>nil</code> if non-blocking connect is supported. </p></dd> <dt><code>(:type datagram)</code></dt> <dd><p>Non-<code>nil</code> if datagrams are supported. </p></dd> <dt><code>(:family local)</code></dt> <dd><p>Non-<code>nil</code> if local (a.k.a. “UNIX domain”) sockets are supported. </p></dd> <dt><code>(:family ipv6)</code></dt> <dd><p>Non-<code>nil</code> if IPv6 is supported. </p></dd> <dt><code>(:service t)</code></dt> <dd><p>Non-<code>nil</code> if the system can select the port for a server. </p></dd> </dl> <p>To test for the availability of a given network option, use <code>featurep</code> like this: </p> <div class="example"> <pre class="example">(featurep 'make-network-process '<var>keyword</var>)
</pre>
</div> <p>The accepted <var>keyword</var> values are <code>:bindtodevice</code>, etc. For the complete list, see <a href="network-options">Network Options</a>. This form returns non-<code>nil</code> if that particular network option is supported by <code>make-network-process</code> (or <code>set-network-process-option</code>). </p><div class="_attribution">
<p class="_attribution-p">
Copyright © 1990-1996, 1998-2022 Free Software Foundation, Inc. <br>Licensed under the GNU GPL license.<br>
<a href="https://www.gnu.org/software/emacs/manual/html_node/elisp/Network-Feature-Testing.html" class="_attribution-link">https://www.gnu.org/software/emacs/manual/html_node/elisp/Network-Feature-Testing.html</a>
</p>
</div>
|