同步操作将从 OpenHarmony/docs 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
The network module implements basic functions of the TCP/IP protocol stack and provides the standard POSIX socket interfaces.
NOTE: Currently, the OS uses lwIP to provide network capabilities.
For user-space development, the OpenHarmony kernel provides a set of APIs for you to implement network functionalities, including creating and disabling sockets, transmitting and receiving data, and setting network attributes, in addition to standard POSIX socket functions provided by the C library.
Table 1 Standard APIs in the C library
Details on API differences:
sendmsg
Function prototype:
ssize_t sendmsg(int s, const struct msghdr *message, int flags)
Function description: sends a message on a socket.
Parameter description:
Indicates the pointer to the message to be sent. The ancillary message is not supported. |
|
Indicates the socket flags for sending the message. The options are as follows: |
Return values:
recvmsg
Function prototype:
ssize_t recvmsg(int s, struct msghdr *message, int flags)
Function description: receives a message from a socket.
Parameter description:
Indicates the pointer to the address to receive the message. The ancillary message is not supported. |
|
Indicates the socket flags for receiving the message. The options are as follows: |
Return values:
ioctl
Function prototype:
int ioctl(int s, int request, ...)
Function description: obtains or sets socket options.
Parameter description:
Indicates the operation to perform on the socket options. The options are as follows: |
Return values:
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。