autodoc.git
/
traditional_manual
/
chapter_9.html
version
»
Context lines:
10
20
40
80
file
none
3
autodoc.git/traditional_manual/chapter_9.html:930:
</td></tr> <tr><td><code><code class='key'>PROP_NONBLOCK</code></code></td><td><p>The resulting pipe supports nonblocking I/O.</p> </td></tr> <tr><td><code><code class='key'>PROP_SHUTDOWN</code></code></td><td><p>The resulting pipe supports shutting down transmission in either direction (see <code>close()</code>).</p> </td></tr> <tr><td><code><code class='key'>PROP_BUFFERED</code></code></td><td><p>The resulting pipe is buffered (usually 4KB).</p> </td></tr> <tr><td><code><code class='key'>PROP_BIDIRECTIONAL</code></code></td><td><p>The resulting pipe is bi-directional.</p> </td></tr>
-
<tr><td><code><code class='key'>PROP_SEND_FD</code></code></td><td><p>The resulting pipe might support sending of file descriptors.</p>
+
<tr><td><code><code class='key'>PROP_SEND_FD</code></code></td><td><p>The resulting pipe might support sending of file descriptors
+
(see <code>send_fd()</code> and <code>receive_fd()</code> for details)
.</p>
</td></tr> <tr><td><code><code class='key'>PROP_REVERSE</code></code></td><td><p>The resulting pipe supports communication "backwards" (but not necessarily "forwards", see <code>PROP_BIDIRECTIONAL</code>).</p> </td></tr> </table><p>The default is <code class='expr'>PROP_NONBLOCK|PROP_BIDIRECTIONAL</code>.</p> <p> If <code>PROP_BIDIRECTIONAL</code> isn't specified, the read-end is this object, and the write-end is the returned object (unless <code>PROP_REVERSE</code> has been specified, in which case it is the other way around).</p> <p> The two ends of a bi-directional pipe are indistinguishable.</p> <p> If the File object this function is called in was open to begin with, it will be closed before the pipe is created.</p> </dd> <dt class='head--doc'>Note</dt> <dd class='body--doc'><p>Calling this function with an argument of <tt>0</tt> is not the same as calling it with no arguments.</p> </dd> <dt class='head--doc'>See also</dt>
-
<dd class='body--doc'><p><code>Process.create_process()</code>,
+
<dd class='body--doc'><p><code>Process.create_process()</code>,
<code>send_fd()</code>, <code>receive_fd()</code>,
<code>PROP_IPC</code>, <code>PROP_NONBLOCK</code>, <code>PROP_SEND_FD</code>, <code>PROP_SHUTDOWN</code>, <code>PROP_BUFFERED</code>, <code>PROP_REVERSE</code>, <code>PROP_BIDIRECTIONAL</code></p> </dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span> <span class='homogen--name'><b>proxy</b></span>
autodoc.git/traditional_manual/chapter_9.html:1201:
mode is used or <code>len</code> is zero.</p> </dd> <dt class='head--doc'>See also</dt> <dd class='body--doc'><p><code>read()</code>, <code>write_oob()</code></p> </dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
+
<span class='homogen--name'><b>receive_fd</b></span>
+
</dt>
+
<dd><p><code><code class='datatype'>void</code> <b><span class='method'>receive_fd</span>(</b><code class='object unresolved'>Stdio.Fd</code> <code class='argument'>fd</code><b>)</b></code></p></dd>
+
+
<dt class='head--doc'>Description</dt>
+
<dd class='body--doc'><p>Remote file descriptor reception handler.</p>
+
</dd>
+
<dt class='head--doc'><span id='p-fd'></span>Parameter <code class='parameter'>fd</code></dt>
+
<dd></dd><dd class='body--doc'><p>File descriptor received from the remote end of a <code>pipe()</code>.
+
This object has been created by <code>fd_factory()</code>.</p>
+
<p> This function is called from <code>read()</code> when a remote file
+
descriptor has been received over a <code>PROP_SEND_FD</code>
+
capable <code>pipe()</code>.</p>
+
<p> The default implementation is just a prototype.</p>
+
<p> Overload this function to enable reception of
+
remote file descriptors.</p>
+
</dd>
+
<dt class='head--doc'>Note</dt>
+
<dd class='body--doc'><p>The capability of sending and receiving remote file
+
descriptors is only available on some operating systems.
+
This capability is indicated by the precence of <code>__HAVE_SEND_FD__</code>.</p>
+
</dd>
+
<dt class='head--doc'>See also</dt>
+
<dd class='body--doc'><p><code>send_fd()</code>, <code>read()</code>, <code>fd_factory()</code>, <code>__HAVE_SEND_FD__</code></p>
+
</dd></dl>
+
+
+
<hr />
+
<dl class='group--doc'>
+
<dt class='head--type'><span class='homogen--type'>Method</span>
<span class='homogen--name'><b>release_fd</b></span> </dt> <dd><p><code><code class='datatype'>int</code> <b><span class='method'>release_fd</span>(</b><b>)</b></code></p></dd> <dt class='head--doc'>Description</dt> <dd class='body--doc'><p>Returns the file descriptor number associated with this object, in addition to releasing it so that this object behaves as if closed. Other settings like callbacks and backend remain intact. <code>take_fd</code> can later be used to reinstate the file descriptor so that the state is restored.</p>
autodoc.git/traditional_manual/chapter_9.html:1260:
should not be used.</p> </dd> <dt class='head--doc'>See also</dt> <dd class='body--doc'><p><code>tell()</code></p> </dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
+
<span class='homogen--name'><b>send_fd</b></span>
+
</dt>
+
<dd><p><code><code class='datatype'>void</code> <b><span class='method'>send_fd</span>(</b><code class='object unresolved'>Stdio.Fd</code> <code class='argument'>fd</code><b>)</b></code></p></dd>
+
+
<dt class='head--doc'>Description</dt>
+
<dd class='body--doc'><p>Queues an open file descriptor for sending to the other end of a stream.</p>
+
</dd>
+
<dt class='head--doc'>Note</dt>
+
<dd class='body--doc'><p>The actual sending is performed at the next successful call
+
to <code>write()</code>, this is due to limitations in the system calls.
+
This means that it isn't possible to send a file descriptor
+
without also sending some in-band data.</p>
+
<p> This operation is only supported on <code>pipe()</code>'s created with
+
<code>PROP_SEND_FD</code>.</p>
+
<p> This function is not available on all operating systems, check
+
for <code>__HAVE_SEND_FD__</code>.</p>
+
<p> The queue is emptied on successful <code>write()</code> and when the
+
write direction is <code>close()</code>'d.</p>
+
</dd>
+
<dt class='head--doc'>See also</dt>
+
<dd class='body--doc'><p><code>receive_fd()</code>, <code>write()</code>, <code>pipe()</code>, <code>read()</code>, <code>__HAVE_SEND_FD__</code></p>
+
</dd></dl>
+
+
+
<hr />
+
<dl class='group--doc'>
+
<dt class='head--type'><span class='homogen--type'>Method</span>
+
<span class='homogen--name'><b>send_fd</b></span>
+
</dt>
+
<dd><p><code><code class='datatype'>bool</code> <b><span class='method'>send_fd</span>(</b><code class='object unresolved'>File</code>|<code class='object unresolved'>Fd</code> <code class='argument'>file</code><b>)</b></code></p></dd>
+
</dl>
+
+
+
<hr />
+
<dl class='group--doc'>
+
<dt class='head--type'><span class='homogen--type'>Method</span>
<span class='homogen--name'><b>set_backend</b></span> </dt> <dd><p><code><code class='datatype'>void</code> <b><span class='method'>set_backend</span>(</b><code class='object unresolved'>Pike.Backend</code> <code class='argument'>backend</code><b>)</b></code></p></dd> <dt class='head--doc'>Description</dt> <dd class='body--doc'><p>Set the backend used for the callbacks.</p> </dd> <dt class='head--doc'>Note</dt> <dd class='body--doc'><p>The backend keeps a reference to this object only when it is in callback mode. So if this object hasn't got any active callbacks
autodoc.git/traditional_manual/chapter_9.html:1874:
without blocking.</p> </li></ul><p>-1 is returned if something went wrong and no bytes were written. If only some data was written due to an error and that error persists, then a later call to <code>write()</code> fails and returns -1.</p> <p> If everything went fine, a call to <code>errno()</code> directly afterwards returns zero.</p> <p> If <code>data</code> is an array of strings, they are written in sequence.</p> <p> If more than one argument is given, <code>sprintf()</code> is used to format them using <code>format</code>. If <code>format</code> is an array, the strings in it are concatenated and the result is used as format string.</p>
+
<p> If there are any file descriptors that have been queued for sending
+
(with <code>send_fd()</code>), they will be sent.</p>
</dd> <dt class='head--doc'>Note</dt> <dd class='body--doc'><p>Writing of wide strings is not supported. You have to encode the data somehow, e.g. with <code>string_to_utf8</code> or with one of the charsets supported by <code>Locale.Charset.encoder</code>.</p> </dd> <dt class='head--doc'>See also</dt>
-
<dd class='body--doc'><p><code>read()</code>, <code>write_oob()</code></p>
+
<dd class='body--doc'><p><code>read()</code>, <code>write_oob()</code>
,
<
code>send_fd()<
/
code></
p>
</dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span> <span class='homogen--name'><b>write_oob</b></span> </dt> <dd><p><code><code class='datatype'>int</code> <b><span class='method'>write_oob</span>(</b><code class='datatype'>string</code> <code class='argument'>data</code><b>)</b></code><br> <code><code class='datatype'>int</code> <b><span class='method'>write_oob</span>(</b><code class='datatype'>string</code> <code class='argument'>format</code>, <code class='datatype'>mixed</code> ... <code class='argument'>extras</code><b>)</b></code></p></dd>
autodoc.git/traditional_manual/chapter_9.html:4410:
<hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Constant</span> <span class='homogen--name'><b>PROP_SEND_FD</b></span> </dt> <dd><p><code><code class='datatype'>constant</code> <code class='datatype'>int</code> Stdio.<code class='constant'>PROP_SEND_FD</code></code></p></dd> <dt class='head--doc'>Description</dt>
-
<dd class='body--doc'><p>The <code>Stdio.File</code> object might support
sending
of open
-
file descriptors
.</p>
+
<dd class='body--doc'><p>The <code>Stdio.File</code> object might support
the
<code>Stdio.File()->send_fd()</code>
+
operation
.</p>
</dd> <dt class='head--doc'>See also</dt>
-
<dd class='body--doc'><p><code>Stdio.File()->pipe()</code></p>
+
<dd class='body--doc'><p><code>Stdio.File()->pipe()</code>
,
<
code>Stdio.File()->send_fd()<
/
code>,
+
<code>Stdio.File()->receive_fd()</code></
p>
</dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Constant</span> <span class='homogen--name'><b>PROP_SHUTDOWN</b></span> </dt> <dd><p><code><code class='datatype'>constant</code> <code class='datatype'>int</code> Stdio.<code class='constant'>PROP_SHUTDOWN</code></code></p></dd>
autodoc.git/traditional_manual/chapter_9.html:4518:
<dd class='body--doc'><p>Exists and has the value 1 if OOB operations are available.</p> </dd> <dt class='head--doc'>Note</dt> <dd class='body--doc'><p>In Pike 7.5 and later OOB operations are always present.</p> </dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Constant</span>
+
<span class='homogen--name'><b>__HAVE_SEND_FD__</b></span>
+
</dt>
+
<dd><p><code><code class='datatype'>constant</code> Stdio.<code class='constant'>__HAVE_SEND_FD__</code></code></p></dd>
+
+
<dt class='head--doc'>Description</dt>
+
<dd class='body--doc'><p>Support for sending of file descriptors over
+
<code>Stdio.File()->pipe()</code> objects with <code>PROP_SEND_FD</code>
+
capability is supported.</p>
+
</dd>
+
<dt class='head--doc'>See also</dt>
+
<dd class='body--doc'><p><code>Stdio.File()->send_fd()</code>, <code>Stdio.File()->receive_fd()</code>,
+
<code>Stdio.File()->read()</code>, <code>Stdio.File()->write()</code>,
+
<code>Stdio.File()->pipe()</code></p>
+
</dd></dl>
+
+
+
<hr />
+
<dl class='group--doc'>
+
<dt class='head--type'><span class='homogen--type'>Constant</span>
<span class='homogen--name'><b>__OOB__</b></span> </dt> <dd><p><code><code class='datatype'>constant</code> Stdio.<code class='constant'>__OOB__</code></code></p></dd> <dt class='head--doc'>Description</dt> <dd class='body--doc'><p>Implementation level of nonblocking I/O OOB support.</p> <table class='box'><tr><td><code><code class='key'>0</code></code></td><td><p>Nonblocking OOB support is not supported.</p> </td></tr> <tr><td><code><code class='key'>1</code></code></td><td><p>Nonblocking OOB works a little.</p> </td></tr>