免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3303 | 回复: 3
打印 上一主题 下一主题

[C] nonblocking 模式 如果send时缓冲区满,返回-1(表示错误),还是0(表示发了0字节) [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2013-05-15 20:52 |只看该作者 |倒序浏览
nonblocking 模式 如果send时缓冲区满,返回-1(表示错误),还是0(表示发了0字节)???求大神解答

论坛徽章:
4
水瓶座
日期:2013-09-06 12:27:30摩羯座
日期:2013-09-28 14:07:46处女座
日期:2013-10-24 14:25:01酉鸡
日期:2014-04-07 11:54:15
2 [报告]
发表于 2013-05-15 21:11 |只看该作者
-1 , errno == EAGAIN.

论坛徽章:
0
3 [报告]
发表于 2013-05-16 09:19 |只看该作者
-1, errno == EAGAIN || errno == EWOULDBLOCK

论坛徽章:
0
4 [报告]
发表于 2013-05-20 23:29 |只看该作者


    The send() function shall fail if:

    [EAGAIN] or [EWOULDBLOCK]

        The socket's file descriptor is marked O_NONBLOCK and the requested operation would block.
    [EBADF]
        The socket argument is not a valid file descriptor.
    [ECONNRESET]
        A connection was forcibly closed by a peer.
    [EDESTADDRREQ]

        The socket is not connection-mode and no peer address is set.
    [EINTR]
        A signal interrupted send() before any data was transmitted.
    [EMSGSIZE]
        The message is too large to be sent all at once, as the socket requires.
    [ENOTCONN]
        The socket is not connected.
    [ENOTSOCK]
        The socket argument does not refer to a socket.
    [EOPNOTSUPP]
        The socket argument is associated with a socket that does not support one or more of the values set in flags.
    [EPIPE]
        The socket is shut down for writing, or the socket is connection-mode and is no longer connected. In the latter case, and if the socket is of type SOCK_STREAM or SOCK_SEQPACKET and the MSG_NOSIGNAL flag is not set, the SIGPIPE signal is generated to the calling thread.

    The send() function may fail if:

    [EACCES]
        The calling process does not have appropriate privileges.
    [EIO]
        An I/O error occurred while reading from or writing to the file system.
    [ENETDOWN]
        The local network interface used to reach the destination is down.
    [ENETUNREACH]

        No route to the network is present.
    [ENOBUFS]
        Insufficient resources were available in the system to perform the operation.

您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP