blob: f4f6b5a825e59dd0e7a7cfa7e1e9a21924817179 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
|
<h3 class="section">Network Servers</h3> <p>You create a server by calling <code>make-network-process</code> (see <a href="network-processes">Network Processes</a>) with <code>:server t</code>. The server will listen for connection requests from clients. When it accepts a client connection request, that creates a new network connection, itself a process object, with the following parameters: </p> <ul> <li> The connection’s process name is constructed by concatenating the server process’s <var>name</var> with a client identification string. The client identification string for an IPv4 connection looks like ‘<samp><<var>a</var>.<var>b</var>.<var>c</var>.<var>d</var>:<var>p</var>></samp>’, which represents an address and port number. Otherwise, it is a unique number in brackets, as in ‘<samp><<var>nnn</var>></samp>’. The number is unique for each connection in the Emacs session. </li>
<li> If the server has a non-default filter, the connection process does not get a separate process buffer; otherwise, Emacs creates a new buffer for the purpose. The buffer name is the server’s buffer name or process name, concatenated with the client identification string. <p>The server’s process buffer value is never used directly, but the log function can retrieve it and use it to log connections by inserting text there. </p> </li>
<li> The communication type and the process filter and sentinel are inherited from those of the server. The server never directly uses its filter and sentinel; their sole purpose is to initialize connections made to the server. </li>
<li> The connection’s process contact information is set according to the client’s addressing information (typically an IP address and a port number). This information is associated with the <code>process-contact</code> keywords <code>:host</code>, <code>:service</code>, <code>:remote</code>. </li>
<li> The connection’s local address is set up according to the port number used for the connection. </li>
<li> The client process’s plist is initialized from the server’s plist. </li>
</ul><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-Servers.html" class="_attribution-link">https://www.gnu.org/software/emacs/manual/html_node/elisp/Network-Servers.html</a>
</p>
</div>
|