Branch: Tag:


2013-05-29 10:03:41 by Henrik Grubbström (Grubba) <>

Stdio.File: Added linger().

Implemented support to change the linger time on sockets.

153:   </dd>   <dt class='head--doc'>Throws</dt>   <dd class='body--doc'><p>An exception is thrown if an I/O error occurs.</p> + <p> The default behaviour for sockets is typically to flush buffered +  data in the background, but this can be changed with <code>linger()</code>.</p>   </dd>   <dt class='head--doc'>Note</dt>   <dd class='body--doc'><p><code>close()</code> has no effect if this file object has been associated
160:    integer as the first argument.</p>   </dd>   <dt class='head--doc'>See also</dt> - <dd class='body--doc'><p><code>open()</code>, <code>open_socket()</code></p> + <dd class='body--doc'><p><code>linger()</code>, <code>open()</code>, <code>open_socket()</code></p>   </dd></dl>      
495:   <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>linger</b></span> + </dt> + <dd><p><code><code class='datatype'>bool</code> <b><span class='method'>linger</span>(</b><code class='datatype'>int(-1..65535)</code>|<code class='datatype'>void</code> <code class='argument'>seconds</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p>Set the socket linger behaviour on <code>close()</code>.</p> + </dd> + <dt class='head--doc'><span id='p-seconds'></span>Parameter <code class='parameter'>seconds</code></dt> + <dd></dd><dd class='body--doc'><table class='box'><tr><td><code><code class='key'>-1</code></code></td><td><p>Reset to default behaviour. This typically means that +  <code>close()</code> will return immediately, but any buffered +  data will still be sent if possible.</p> + </td></tr> + <tr><td><code><code class='key'>0</code></code></td><td><p>Terminate the connection immediately on <code>close()</code>, +  and discard any buffered data.</p> + </td></tr> + <tr><td><code><code class='key'>(1..65535)</code></code></td><td><p>Have <code>close()</code> wait for at most <code>seconds</code> seconds +  for any buffered data to be sent after which the +  connection is terminated.</p> + </td></tr> + </table> + </dd> + <dt class='head--doc'>Returns</dt> + <dd class='body--doc'><p>Returns <code class='expr'>1</code> on success, and <code class='expr'>0</code> (zero) on failure.</p> + </dd> + <dt class='head--doc'>Note</dt> + <dd class='body--doc'><p>This operation is only valid on sockets.</p> + </dd> + <dt class='head--doc'>Note</dt> + <dd class='body--doc'><p>This function was not available in Pike 7.8.775 and earlier.</p> + </dd> + <dt class='head--doc'>See also</dt> + <dd class='body--doc'><p><code>close()</code></p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span>   <span class='homogen--name'><b>listxattr</b></span>   </dt>   <dd><p><code><code class='datatype'>array</code>(<code class='datatype'>string</code>) <b><span class='method'>listxattr</span>(</b><b>)</b></code></p></dd>