手机版
你好,游客 登录 注册
背景:
阅读新闻

Linux系统编程之getsockopt/setsockopt 函数

[日期:2012-08-01] 来源:Linux社区  作者:wallwind [字体:大 中 小]

以上英文的比较难看,给大家一个链接 http://www.linuxidc.com/Linux/2012-08/66981.htm

详细讲述了选项的使用。

RETURN VALUE
成功的话就会返回0,失败返回-1,失败的时候会这是errorno值。下面是几个选项值。

ERRORS
The setsockopt() function shall fail if:

[EBADF]
The socket argument is not a valid file descriptor.
[EDOM]
The send and receive timeout values are too big to fit into the timeout fields in the socket structure.
[EINVAL]
The specified option is invalid at the specified socket level or the socket has been shut down.
[EISCONN]
The socket is already connected, and a specified option cannot be set while the socket is connected.
[ENOPROTOOPT]
The option is not supported by the protocol.
[ENOTSOCK]
The socket argument does not refer to a socket.
The setsockopt() function may fail if:

[ENOMEM]
There was insufficient memory available for the operation to complete.
[ENOBUFS]
Insufficient resources are available in the system to complete the call.

linux
相关资讯       Linux编程  Linux系统编程 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款