Branch: Tag:

2008-12-12

2008-12-12 10:36:52 by Jonas Wallden <jonasw@roxen.com>

Expose system-dependent address family constants so that we can get IPv6
working in Protocols.HTTP.Query via explicit Stdio.open_socket() parameter.

Rev: CHANGES:1.162
Rev: lib/modules/Protocols.pmod/HTTP.pmod/Query.pike:1.97
Rev: lib/modules/Stdio.pmod/module.pmod:1.247
Rev: src/modules/files/file.c:1.396

695:   <dd class='body--doc'><p>This makes this file into a socket ready for connections. The reason    for this function is so that you can set the socket to nonblocking    or blocking (default is blocking) before you call <code>connect()</code>.</p> - <p> If you give a <code>port</code> number to this function, the socket will be -  bound to this <code>port</code> locally before connecting anywhere. This is -  only useful for some silly protocols like <b>FTP</b>. You may also -  specify an <code>address</code> to bind to if your machine has many IP numbers.</p> - <p> <code>port</code> can also be specified as a string, giving the name of the -  service associated with the port.</p> - <p> Finally, a protocol <code>family</code> for the socket can be specified. -  If no <code>family</code> is specified, one which is appropriate for the -  <code>address</code> is automatically selected. Thus, there is normally -  no need to specify it.</p> +    </dd> -  + <dt class='head--doc'><span id='p-port'></span>Parameter <code class='parameter'>port</code></dt> + <dd></dd><dd class='body--doc'><p>If you give a port number to this function, the socket will be +  bound to this port locally before connecting anywhere. This is +  only useful for some silly protocols like <b>FTP</b>. The port can +  also be specified as a string, giving the name of the service +  associated with the port.</p> + </dd> + <dt class='head--doc'><span id='p-address'></span>Parameter <code class='parameter'>address</code></dt> + <dd></dd><dd class='body--doc'><p>You may specify an address to bind to if your machine has many IP +  numbers.</p> + </dd> + <dt class='head--doc'><span id='p-protocol'></span>Parameter <code class='parameter'>protocol</code></dt> + <dd></dd><dd class='body--doc'><p>A protocol family for the socket can be specified. If no family is +  specified, one which is appropriate for the address is automatically +  selected. Thus, there is normally no need to specify it. You can +  find system-dependent constants for IPv4 and IPv6 in <code>Stdio.AF_INET</code> +  and <code>Stdio.AF_INET6</code>.</p> + </dd>   <dt class='head--doc'>Returns</dt>   <dd class='body--doc'><p>This function returns 1 for success, 0 otherwise.</p>   </dd>
4121:   <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Constant</span> + <span class='homogen--name'><b>AF_INET</b></span> + </dt> + <dd><p><code><code class='datatype'>constant</code> Stdio.<code class='constant'>AF_INET</code></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p>Address family identifier for IPv4. Note that this is system-dependent.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Constant</span> + <span class='homogen--name'><b>AF_INET6</b></span> + </dt> + <dd><p><code><code class='datatype'>constant</code> Stdio.<code class='constant'>AF_INET6</code></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p>Address family identifier for IPv6. Note that this is system-dependent.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Constant</span> + <span class='homogen--name'><b>AF_UNIX</b></span> + </dt> + <dd><p><code><code class='datatype'>constant</code> Stdio.<code class='constant'>AF_UNIX</code></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p>Address family identifier for local pipes. Note that this +  is system-dependent. AF_LOCAL and AF_FILE are aliases for +  AF_UNIX.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Constant</span>   <span class='homogen--name'><b>DN_ACCESS</b></span>   </dt>   <dd><p><code><code class='datatype'>constant</code> Stdio.<code class='constant'>DN_ACCESS</code></code></p></dd>