Downloads
Documentation
Get Involved
Help
Search docs
ConFoo 2025
Getting Started
Introduction
A simple tutorial
Language Reference
Basic syntax
Types
Variables
Constants
Expressions
Operators
Control Structures
Functions
Classes and Objects
Namespaces
Enumerations
Errors
Exceptions
Fibers
Generators
Attributes
References Explained
Predefined Variables
Predefined Exceptions
Predefined Interfaces and Classes
Predefined Attributes
Context options and parameters
Supported Protocols and Wrappers
Security
Introduction
General considerations
Installed as CGI binary
Installed as an Apache module
Session Security
Filesystem Security
Database Security
Error Reporting
User Submitted Data
Hiding PHP
Keeping Current
Features
HTTP authentication with PHP
Cookies
Sessions
Handling file uploads
Using remote files
Connection handling
Persistent Database Connections
Command line usage
Garbage Collection
DTrace Dynamic Tracing
Function Reference
Affecting PHP's Behaviour
Audio Formats Manipulation
Authentication Services
Command Line Specific Extensions
Compression and Archive Extensions
Cryptography Extensions
Database Extensions
Date and Time Related Extensions
File System Related Extensions
Human Language and Character Encoding Support
Image Processing and Generation
Mail Related Extensions
Mathematical Extensions
Non-Text MIME Output
Process Control Extensions
Other Basic Extensions
Other Services
Search Engine Extensions
Server Specific Extensions
Session Extensions
Text Processing
Variable and Type Related Extensions
Web Services
Windows Only Extensions
XML Manipulation
GUI Extensions
Keyboard Shortcuts
?
This help
j
Next menu item
k
Previous menu item
g p
Previous man page
g n
Next man page
G
Scroll to bottom
g g
Scroll to top
g h
Goto homepage
g s
Goto search
(current page)
/
Focus search box
简介 »
« SNMPException
PHP 手册
函数参考
其它服务
切换语言:
English
German
Spanish
French
Italian
Japanese
Brazilian Portuguese
Russian
Turkish
Ukrainian
Chinese (Simplified)
Other
Socket
简介
安装/配置
安装
资源类型
预定义常量
示例
Socket Errors
Socket 函数
socket_accept
— 接受套接字上的连接
socket_addrinfo_bind
— 从给定的 addrinfo 创建并绑定一个套接字
socket_addrinfo_connect
— 指定 addrinfo 创建并连接套接字
socket_addrinfo_explain
— 获取有关 addrinfo 的信息
socket_addrinfo_lookup
— 获取数组,包含有关给定主机名的 getaddrinfo 内容
socket_atmark
— 确认 socket 是否处于带外数据标记
socket_bind
— 给套接字绑定名字
socket_clear_error
— 清除套接字或者最后的错误代码上的错误
socket_close
— 关闭 Socket 实例
socket_cmsg_space
— Calculate message buffer size
socket_connect
— 开启一个套接字连接
socket_create
— 创建一个套接字(通讯节点)
socket_create_listen
— 在端口上打开一个套接字以接受连接
socket_create_pair
— 创建一对彼此连接的套接字,并用数组存储
socket_export_stream
— Export a socket into a stream that encapsulates a socket
socket_get_option
— 获取套接字的套接字选项
socket_getopt
— 别名 socket_get_option
socket_getpeername
— 获取套接字远端名字
socket_getsockname
— 获取套接字本地端的名字,返回主机名和端口号或是 Unix 文件系统路径,具体取决于套接字类型
socket_import_stream
— 导入 stream
socket_last_error
— 返回套接字上的最后一个错误
socket_listen
— 监听套接字的连接
socket_read
— 从套接字中读取最大长度的数据
socket_recv
— 从已连接的 socket 接收数据
socket_recvfrom
— 从套接字接收数据,无论它是否是面向连接的
socket_recvmsg
— Read a message
socket_select
— 从给定套接字数组运行带指定超时时间的 select() 系统调用
socket_send
— 向已连接的套接字发送数据
socket_sendmsg
— Send a message
socket_sendto
— 向套接字发送消息,无论它是否已建立连接
socket_set_block
— 设置套接字为阻塞模式
socket_set_nonblock
— 设置套接字为非阻塞模式
socket_set_option
— 为套接字设置套接字选项
socket_setopt
— 别名 socket_set_option
socket_shutdown
— 关闭套接字接收或发送,或两者都关闭
socket_strerror
— 返回描述套接字错误的字符串
socket_write
— 向套接字写数据
socket_wsaprotocol_info_export
— 导出 WSAPROTOCOL_INFO 结构体
socket_wsaprotocol_info_import
— 从另一个进程导入套接字
socket_wsaprotocol_info_release
— 释放已导出的 WSAPROTOCOL_INFO 结构体
Socket
— Socket 类
AddressInfo
— AddressInfo 类
发现了问题?
了解如何改进此页面
•
提交拉取请求
•
报告一个错误
+
添加备注
用户贡献的备注
此页面尚无用户贡献的备注。
↑
and
↓
to navigate •
Enter
to select •
Esc
to close
Press
Enter
without selection to search using Google