<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <HTML ><HEAD ><TITLE >php_stream_sock_open_unix</TITLE ><META NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK REL="HOME" TITLE="PHP 手册" HREF="index.html"><LINK REL="UP" TITLE="Streams Socket API Reference" HREF="streams.socket-api.html"><LINK REL="PREVIOUS" TITLE="php_stream_sock_open_host" HREF="streams.php-stream-sock-open-host.html"><LINK REL="NEXT" TITLE="Streams Structures" HREF="streams.structs.html"><META HTTP-EQUIV="Content-type" CONTENT="text/html; charset=UTF-8"></HEAD ><BODY CLASS="refentry" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#840084" ALINK="#0000FF" ><DIV CLASS="NAVHEADER" ><TABLE SUMMARY="Header navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TH COLSPAN="3" ALIGN="center" >PHP 手册</TH ></TR ><TR ><TD WIDTH="10%" ALIGN="left" VALIGN="bottom" ><A HREF="streams.php-stream-sock-open-host.html" ACCESSKEY="P" >上一页</A ></TD ><TD WIDTH="80%" ALIGN="center" VALIGN="bottom" ></TD ><TD WIDTH="10%" ALIGN="right" VALIGN="bottom" ><A HREF="streams.structs.html" ACCESSKEY="N" >下一页</A ></TD ></TR ></TABLE ><HR ALIGN="LEFT" WIDTH="100%"></DIV ><H1 ><A NAME="streams.php-stream-sock-open-unix" ></A >php_stream_sock_open_unix</H1 ><DIV CLASS="refnamediv" ><A NAME="AEN253462" ></A >php_stream_sock_open_unix -- Open a Unix domain socket and convert into a stream</DIV ><DIV CLASS="refsect1" ><A NAME="AEN253465" ></A ><H2 >Description</H2 >php_stream * <B CLASS="methodname" >php_stream_sock_open_unix</B > ( const char * path, int pathlen, int persistent, struct timeval * timeout )<BR ></BR ><P > <B CLASS="function" >php_stream_sock_open_unix()</B > attempts to open the Unix domain socket specified by <CODE CLASS="parameter" >path</CODE >. <CODE CLASS="parameter" >pathlen</CODE > specifies the length of <CODE CLASS="parameter" >path</CODE >. If <CODE CLASS="parameter" >timeout</CODE > is not NULL, it specifies a timeout period for the connection attempt. <CODE CLASS="parameter" >persistent</CODE > indicates if the stream should be opened as a persistent stream. Generally speaking, this parameter will usually be 0. </P ><DIV CLASS="note" ><BLOCKQUOTE CLASS="note" ><P ><B >注意: </B > This function will not work under Windows, which does not implement Unix domain sockets. A possible exception to this rule is if your PHP binary was built using cygwin. You are encouraged to consider this aspect of the portability of your extension before it's release. </P ></BLOCKQUOTE ></DIV ><DIV CLASS="note" ><BLOCKQUOTE CLASS="note" ><P ><B >注意: </B > This function treats <CODE CLASS="parameter" >path</CODE > in a binary safe manner, suitable for use on systems with an abstract namespace (such as Linux), where the first character of path is a NUL character. </P ></BLOCKQUOTE ></DIV ></DIV ><DIV CLASS="NAVFOOTER" ><HR ALIGN="LEFT" WIDTH="100%"><TABLE SUMMARY="Footer navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" ><A HREF="streams.php-stream-sock-open-host.html" ACCESSKEY="P" >上一页</A ></TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="index.html" ACCESSKEY="H" >起始页</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" ><A HREF="streams.structs.html" ACCESSKEY="N" >下一页</A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" >php_stream_sock_open_host</TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="streams.socket-api.html" ACCESSKEY="U" >上一级</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" >Streams Structures</TD ></TR ></TABLE ></DIV ></BODY ></HTML >