autodoc.git
/
traditional_manual
/
chapter_9.html
version
»
Context lines:
10
20
40
80
file
none
3
autodoc.git/traditional_manual/chapter_9.html:682:
callbacks. It requires a thread to be waiting in it to execute the calls. That means that only one of the callbacks will be running at a time, so you don't need mutexes between them.</p> <p> Unless you've specified otherwise with the <code>set_backend</code> function, the default backend <code>Pike.DefaultBackend</code> will be used. It's normally activated by returning <code class='expr'>-1</code> from the <tt>main</tt> function and will then execute in the main thread.</p> <ul> <li><p>When data arrives on the stream, <code>read_cb</code> will be called with some or all of that data as the second argument.</p>
-
<p> If the file is in buffer mode, the second argument will be
an
Buffer.</p>
+
<p> If the file is in buffer mode, the second argument will be
a
Buffer.</p>
<p> This will always be the same buffer, so data you do not use in one read callback can be simply left in the buffer, when new data arrives it will be appended</p> </li><li><p>When the stream has buffer space over for writing, <code>write_cb</code> will be called so that you can write more data to it.</p> <p> This callback is also called after the remote end of a socket connection has closed the write direction. An attempt to write data to it in that case will generate a <code>System.EPIPE</code> errno. If the remote end has closed both directions simultaneously (the usual case), Pike will first attempt to call <code>close_cb</code>, then this callback (unless <code>close_cb</code> has closed the stream).</p>
-
<p> If the file is in buffer mode, the second argument will be
an
Buffer.</p>
+
<p> If the file is in buffer mode, the second argument will be
a
Buffer.</p>
<p> You should add data to write to this buffer.</p> </li><li><p>When out-of-band data arrives on the stream, <code>read_oob_cb</code> will be called with some or all of that data as the second argument.</p> </li><li><p>When the stream allows out-of-band data to be sent, <code>write_oob_cb</code> will be called so that you can write more out-of-band data to it.</p> <p> If the OS doesn't separate the write events for normal and out-of-band data, Pike will try to call <code>write_oob_cb</code> first. If it doesn't write anything, then <code>write_cb</code> will be tried.
autodoc.git/traditional_manual/chapter_9.html:4005:
<dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Typedef</span> <span class='homogen--name'><b>read_callback_t</b></span> </dt> <dd><p><code><code class='datatype'><code class='modifier'>local</code> typedef</code> <code class='datatype'>function</code>(<code class='datatype'>mixed</code>|<code class='datatype'>void</code>, <code class='datatype'>string</code>:<code class='datatype'>int</code>|<code class='datatype'>void</code>)|<code class='datatype'>function</code>(<code class='datatype'>mixed</code>|<code class='datatype'>void</code>, <code class='object unresolved'>Buffer</code>:<code class='datatype'>int</code>|<code class='datatype'>void</code>)|<code class='datatype'>function</code>(<code class='datatype'>mixed</code>|<code class='datatype'>void</code>:<code class='datatype'>int</code>|<code class='datatype'>void</code>) Stdio.<code class='typedef'>read_callback_t</code></code></p></dd> <dt class='head--doc'>Description</dt> <dd class='body--doc'><p>The various read_callback signatures.</p> <p> The string (or void) version is used when buffer mode (see <code>set_buffer_mode</code>) has not been enabled for reading.</p>
-
<p> The Buffer version is used when
an
Buffer has been enabled
+
<p> The Buffer version is used when
a
Buffer has been enabled
for reading</p> <p> In both cases the data is the newly arrived data, but in buffered mode data you did not fully read in the last read callback is kept in the buffer.</p> </dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span>
autodoc.git/traditional_manual/chapter_9.html:4219:
<dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Typedef</span> <span class='homogen--name'><b>write_callback_t</b></span> </dt> <dd><p><code><code class='datatype'><code class='modifier'>local</code> typedef</code> <code class='datatype'>function</code>(<code class='datatype'>mixed</code>|<code class='datatype'>void</code>:<code class='datatype'>int</code>|<code class='datatype'>void</code>)|<code class='datatype'>function</code>(<code class='datatype'>mixed</code>|<code class='datatype'>void</code>, <code class='object unresolved'>Buffer</code>:<code class='datatype'>int</code>|<code class='datatype'>void</code>) Stdio.<code class='typedef'>write_callback_t</code></code></p></dd> <dt class='head--doc'>Description</dt> <dd class='body--doc'><p>The various write_callback signatures.</p> <p> The void version is used when buffer mode (see <code>set_buffer_mode</code>) has not been enabled for writing.</p>
-
<p> The Buffer version is used when
an
Buffer has been enabled
+
<p> The Buffer version is used when
a
Buffer has been enabled
for reading, add data to that buffer to send it.</p> </dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Method</span> <span class='homogen--name'><b>write_file</b></span> </dt> <dd><p><code><code class='datatype'>int</code> <b><span class='method'>write_file</span>(</b><code class='datatype'>string</code> <code class='argument'>filename</code>, <code class='datatype'>string</code> <code class='argument'>str</code>, <code class='datatype'>int</code>|<code class='datatype'>void</code> <code class='argument'>access</code><b>)</b></code></p></dd>