<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.sockets.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'en',
  ),
  'this' => 
  array (
    0 => 'function.socket-addrinfo-bind.php',
    1 => 'socket_addrinfo_bind',
    2 => 'Create and bind to a socket from a given addrinfo',
  ),
  'up' => 
  array (
    0 => 'ref.sockets.php',
    1 => 'Socket Functions',
  ),
  'prev' => 
  array (
    0 => 'function.socket-accept.php',
    1 => 'socket_accept',
  ),
  'next' => 
  array (
    0 => 'function.socket-addrinfo-connect.php',
    1 => 'socket_addrinfo_connect',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/sockets/functions/socket-addrinfo-bind.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.socket-addrinfo-bind" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">socket_addrinfo_bind</h1>
  <p class="verinfo">(PHP 7 &gt;= 7.2.0, PHP 8)</p><p class="refpurpose"><span class="refname">socket_addrinfo_bind</span> &mdash; <span class="dc-title">Create and bind to a socket from a given addrinfo</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.socket-addrinfo-bind-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>socket_addrinfo_bind</strong></span>(<span class="methodparam"><span class="type"><a href="class.addressinfo.php" class="type AddressInfo">AddressInfo</a></span> <code class="parameter">$address</code></span>): <span class="type"><span class="type"><a href="class.socket.php" class="type Socket">Socket</a></span>|<span class="type"><a href="language.types.singleton.php" class="type false">false</a></span></span></div>

  <p class="para rdfs-comment">
   Create a <span class="classname"><a href="class.socket.php" class="classname">Socket</a></span> instance, and bind it to the provided <span class="classname"><a href="class.addressinfo.php" class="classname">AddressInfo</a></span>.  The return
   value of this function may be used with <span class="function"><a href="function.socket-listen.php" class="function">socket_listen()</a></span>.
  </p>

 </div>


 <div class="refsect1 parameters" id="refsect1-function.socket-addrinfo-bind-parameters">
  <h3 class="title">Parameters</h3>
  <dl>
   
    <dt><code class="parameter">address</code></dt>
    <dd>
     <p class="para">
      <span class="classname"><a href="class.addressinfo.php" class="classname">AddressInfo</a></span> instance created from <span class="function"><a href="function.socket-addrinfo-lookup.php" class="function">socket_addrinfo_lookup()</a></span>.
     </p>
    </dd>
   
  </dl>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.socket-addrinfo-bind-returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="para">
   Returns a <span class="classname"><a href="class.socket.php" class="classname">Socket</a></span> instance on success or <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> on failure.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.socket-addrinfo-bind-changelog">
  <h3 class="title">Changelog</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>Version</th>
      <th>Description</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td>8.0.0</td>
      <td>
       On success, this function returns a <span class="classname"><a href="class.socket.php" class="classname">Socket</a></span> instance now;
       previously, a <span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span> was returned.
      </td>
     </tr>

     <tr>
 <td>8.0.0</td>
 <td>
  <code class="parameter">address</code> is an <span class="classname"><a href="class.addressinfo.php" class="classname">AddressInfo</a></span> instance now;
  previously, it was a <span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span>.
 </td>
</tr>

    </tbody>
   
  </table>

 </div>


 <div class="refsect1 seealso" id="refsect1-function.socket-addrinfo-bind-seealso">
  <h3 class="title">See Also</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.socket-addrinfo-connect.php" class="function" rel="rdfs-seeAlso">socket_addrinfo_connect()</a> - Create and connect to a socket from a given addrinfo</span></li>
    <li><span class="function"><a href="function.socket-addrinfo-explain.php" class="function" rel="rdfs-seeAlso">socket_addrinfo_explain()</a> - Get information about addrinfo</span></li>
    <li><span class="function"><a href="function.socket-addrinfo-lookup.php" class="function" rel="rdfs-seeAlso">socket_addrinfo_lookup()</a> - Get array with contents of getaddrinfo about the given hostname</span></li>
    <li><span class="function"><a href="function.socket-listen.php" class="function" rel="rdfs-seeAlso">socket_listen()</a> - Listens for a connection on a socket</span></li>
   </ul>
  </p>
 </div>

 
</div><?php manual_footer($setup); ?>