CAsyncSocket的send返回10035异常时,数据会丢失吗
答案:2 悬赏:10 手机版
解决时间 2021-02-21 19:28
- 提问者网友:听门外雪花风
- 2021-02-21 04:33
CAsyncSocket的send返回10035异常时,数据会丢失吗
最佳答案
- 五星知识达人网友:山有枢
- 2021-02-21 06:05
CAsyncSocket会将socket设置为非阻塞的,所以send返回10035是正常的,看msdn上说的:
This error is returned from operations on nonblocking sockets that cannot be completed immediately, for example recv when no data is queued to be read from the socket. It is a nonfatal error, and the operation should be retried later. It is normal for WSAEWOULDBLOCK to be reported as the result from calling connect on a nonblocking SOCK_STREAM socket, since some time must elapse for the connection to be established.
你应该在FD_WRITE这里继续进行send操作,同时要记住之前发送了多少。
This error is returned from operations on nonblocking sockets that cannot be completed immediately, for example recv when no data is queued to be read from the socket. It is a nonfatal error, and the operation should be retried later. It is normal for WSAEWOULDBLOCK to be reported as the result from calling connect on a nonblocking SOCK_STREAM socket, since some time must elapse for the connection to be established.
你应该在FD_WRITE这里继续进行send操作,同时要记住之前发送了多少。
全部回答
- 1楼网友:西岸风
- 2021-02-21 07:26
任务占坑
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯