PR_Send 编辑
Sends bytes from a connected socket.
Syntax
#include <prio.h> /wiki/en-US/docs/Mozilla/Projects/NSPR/Reference/PRInt32 PR_Send( /wiki/en-US/docs/Mozilla/Projects/NSPR/Reference/PRFileDesc *fd, const void *buf, /wiki/en-US/docs/Mozilla/Projects/NSPR/Reference/PRInt32 amount, /wiki/en-US/docs/Mozilla/Projects/NSPR/Reference/PRIntn flags, /wiki/en-US/docs/Mozilla/Projects/NSPR/Reference/PRIntervalTime timeout);
Parameters
The function has the following parameters:
fd
- A pointer to a
/wiki/en-US/docs/Mozilla/Projects/NSPR/Reference/PRFileDesc
object representing a socket. buf
- A pointer to a buffer containing the data to be sent.
amount
- The size of
buf
(in bytes). flags
- This obsolete parameter must always be zero.
timeout
- A value of type
/wiki/en-US/docs/Mozilla/Projects/NSPR/Reference/PRIntervalTime
specifying the time limit for completion of the receive operation.
Returns
The function returns one of the following values:
- A positive number indicates the number of bytes successfully sent. If the parameter fd is a blocking socket, this number must always equal amount.
- The value -1 indicates a failure. The reason for the failure can be obtained by calling
/wiki/en-US/docs/Mozilla/Projects/NSPR/Reference/PR_GetError
.
Description
PR_Send
blocks until all bytes are sent, a timeout occurs, or an error occurs.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论