<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/book.sockets.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'zh',
  ),
  'this' => 
  array (
    0 => 'ref.sockets.php',
    1 => 'Socket 函数',
    2 => 'Socket 函数',
  ),
  'up' => 
  array (
    0 => 'book.sockets.php',
    1 => 'Socket',
  ),
  'prev' => 
  array (
    0 => 'sockets.errors.php',
    1 => 'Socket Errors',
  ),
  'next' => 
  array (
    0 => 'function.socket-accept.php',
    1 => 'socket_accept',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'zh',
    'path' => 'reference/sockets/reference.xml',
  ),
  'history' => 
  array (
  ),
  'extra_header_links' => 
  array (
    'rel' => 'alternate',
    'href' => '/manual/en/feeds/ref.sockets.atom',
    'type' => 'application/atom+xml',
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="ref.sockets" class="reference">
 <h1 class="title">Socket 函数</h1>

 






























































































































































































































































<h2>目录</h2><ul class="chunklist chunklist_reference"><li><a href="function.socket-accept.php">socket_accept</a> — 接受套接字上的连接</li><li><a href="function.socket-addrinfo-bind.php">socket_addrinfo_bind</a> — 从给定的 addrinfo 创建并绑定一个套接字</li><li><a href="function.socket-addrinfo-connect.php">socket_addrinfo_connect</a> — 指定 addrinfo 创建并连接套接字</li><li><a href="function.socket-addrinfo-explain.php">socket_addrinfo_explain</a> — 获取有关 addrinfo 的信息</li><li><a href="function.socket-addrinfo-lookup.php">socket_addrinfo_lookup</a> — 获取数组，包含有关给定主机名的 getaddrinfo 内容</li><li><a href="function.socket-atmark.php">socket_atmark</a> — 确认 socket 是否处于带外数据标记</li><li><a href="function.socket-bind.php">socket_bind</a> — 给套接字绑定名字</li><li><a href="function.socket-clear-error.php">socket_clear_error</a> — 清除套接字或者最后的错误代码上的错误</li><li><a href="function.socket-close.php">socket_close</a> — 关闭 Socket 实例</li><li><a href="function.socket-cmsg-space.php">socket_cmsg_space</a> — Calculate message buffer size</li><li><a href="function.socket-connect.php">socket_connect</a> — 开启一个套接字连接</li><li><a href="function.socket-create.php">socket_create</a> — 创建一个套接字（通讯节点）</li><li><a href="function.socket-create-listen.php">socket_create_listen</a> — 在端口上打开一个套接字以接受连接</li><li><a href="function.socket-create-pair.php">socket_create_pair</a> — 创建一对彼此连接的套接字，并用数组存储</li><li><a href="function.socket-export-stream.php">socket_export_stream</a> — Export a socket into a stream that encapsulates a socket</li><li><a href="function.socket-get-option.php">socket_get_option</a> — 获取套接字的套接字选项</li><li><a href="function.socket-getopt.php">socket_getopt</a> — 别名 socket_get_option</li><li><a href="function.socket-getpeername.php">socket_getpeername</a> — 获取套接字远端名字</li><li><a href="function.socket-getsockname.php">socket_getsockname</a> — 获取套接字本地端的名字，返回主机名和端口号或是 Unix 文件系统路径，具体取决于套接字类型</li><li><a href="function.socket-import-stream.php">socket_import_stream</a> — 导入 stream</li><li><a href="function.socket-last-error.php">socket_last_error</a> — 返回套接字上的最后一个错误</li><li><a href="function.socket-listen.php">socket_listen</a> — 监听套接字的连接</li><li><a href="function.socket-read.php">socket_read</a> — 从套接字中读取最大长度的数据</li><li><a href="function.socket-recv.php">socket_recv</a> — 从已连接的 socket 接收数据</li><li><a href="function.socket-recvfrom.php">socket_recvfrom</a> — 从套接字接收数据，无论它是否是面向连接的</li><li><a href="function.socket-recvmsg.php">socket_recvmsg</a> — Read a message</li><li><a href="function.socket-select.php">socket_select</a> — 从给定套接字数组运行带指定超时时间的 select() 系统调用</li><li><a href="function.socket-send.php">socket_send</a> — 向已连接的套接字发送数据</li><li><a href="function.socket-sendmsg.php">socket_sendmsg</a> — Send a message</li><li><a href="function.socket-sendto.php">socket_sendto</a> — 向套接字发送消息，无论它是否已建立连接</li><li><a href="function.socket-set-block.php">socket_set_block</a> — 设置套接字为阻塞模式</li><li><a href="function.socket-set-nonblock.php">socket_set_nonblock</a> — 设置套接字为非阻塞模式</li><li><a href="function.socket-set-option.php">socket_set_option</a> — 为套接字设置套接字选项</li><li><a href="function.socket-setopt.php">socket_setopt</a> — 别名 socket_set_option</li><li><a href="function.socket-shutdown.php">socket_shutdown</a> — 关闭套接字接收或发送，或两者都关闭</li><li><a href="function.socket-strerror.php">socket_strerror</a> — 返回描述套接字错误的字符串</li><li><a href="function.socket-write.php">socket_write</a> — 向套接字写数据</li><li><a href="function.socket-wsaprotocol-info-export.php">socket_wsaprotocol_info_export</a> — 导出 WSAPROTOCOL_INFO 结构体</li><li><a href="function.socket-wsaprotocol-info-import.php">socket_wsaprotocol_info_import</a> — 从另一个进程导入套接字</li><li><a href="function.socket-wsaprotocol-info-release.php">socket_wsaprotocol_info_release</a> — 释放已导出的 WSAPROTOCOL_INFO 结构体</li></ul>
</div>
<?php manual_footer($setup); ?>