<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Create and connect to a socket from a given addrinfo</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.socket-addrinfo-bind.html">socket_addrinfo_bind</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.socket-addrinfo-explain.html">socket_addrinfo_explain</a></div> <div class="up"><a href="ref.sockets.html">Socket Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="function.socket-addrinfo-connect" class="refentry"> <div class="refnamediv"> <h1 class="refname">socket_addrinfo_connect</h1> <p class="verinfo">(PHP 7 >= 7.2.0)</p><p class="refpurpose"><span class="refname">socket_addrinfo_connect</span> — <span class="dc-title">Create and connect to a socket from a given addrinfo</span></p> </div> <div class="refsect1 description" id="refsect1-function.socket-addrinfo-connect-description"> <h3 class="title">Description</h3> <div class="methodsynopsis dc-description"> <span class="type">resource</span> <span class="methodname"><strong>socket_addrinfo_connect</strong></span> ( <span class="methodparam"><span class="type">resource</span> <code class="parameter">$addr</code></span> )</div> <p class="para rdfs-comment"> Create a Socket resource, and connect it to the provided AddrInfo resource. The return value of this function may be used with the rest of the socket functions. </p> </div> <div class="refsect1 parameters" id="refsect1-function.socket-addrinfo-connect-parameters"> <h3 class="title">Parameters</h3> <dl> <dt> <code class="parameter">addr</code></dt> <dd> <p class="para"> Resource created from <span class="function"><strong>socket_addrinfo_lookup()()</strong></span> </p> </dd> </dl> </div> <div class="refsect1 returnvalues" id="refsect1-function.socket-addrinfo-connect-returnvalues"> <h3 class="title">Return Values</h3> <p class="para"> Returns a Socket resource on success or <strong><code>NULL</code></strong> on failure. </p> </div> <div class="refsect1 seealso" id="refsect1-function.socket-addrinfo-connect-seealso"> <h3 class="title">See Also</h3> <p class="para"> <ul class="simplelist"> <li class="member"><span class="function"><a href="function.socket-addrinfo-bind.html" class="function" rel="rdfs-seeAlso">socket_addrinfo_bind()</a> - Create and bind to a socket from a given addrinfo</span></li> <li class="member"><span class="function"><a href="function.socket-addrinfo-explain.html" class="function" rel="rdfs-seeAlso">socket_addrinfo_explain()</a> - Get information about addrinfo</span></li> <li class="member"><span class="function"><a href="function.socket-addrinfo-lookup.html" class="function" rel="rdfs-seeAlso">socket_addrinfo_lookup()</a> - Get array with contents of getaddrinfo about the given hostname</span></li> </ul> </p> </div> </div><hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.socket-addrinfo-bind.html">socket_addrinfo_bind</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.socket-addrinfo-explain.html">socket_addrinfo_explain</a></div> <div class="up"><a href="ref.sockets.html">Socket Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>