LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
123
返回列表 发新帖
楼主: 非飞

如何清空socket缓冲区

[复制链接]
发表于 2004-11-29 20:13:48 | 显示全部楼层
hf,我觉得这是你理解的问题,不是人家开发部门的问题,一般在应用上的超时,不会是setsockopt的那个
发表于 2004-11-30 08:34:40 | 显示全部楼层
如果这样能把程序改好了,才叫神奇
 楼主| 发表于 2004-12-13 03:10:28 | 显示全部楼层
最初由 x11 发表
hf,我觉得这是你理解的问题,不是人家开发部门的问题,一般在应用上的超时,不会是setsockopt的那个


那请问一下应用上的超时一般是怎么实现的?
发表于 2004-12-14 16:07:07 | 显示全部楼层
select啊
发表于 2004-12-16 09:16:05 | 显示全部楼层
可不可以建一个buffer
清空时向里面写一个空字符就好了
发表于 2004-12-16 16:08:24 | 显示全部楼层
最初由 无人喝彩 发表
可不可以建一个buffer
清空时向里面写一个空字符就好了

如果buffer是在堆栈上,还是自己memset吧。
发表于 2004-12-23 22:21:54 | 显示全部楼层
上边说的对啊
不要的就丢了三
 楼主| 发表于 2004-12-27 18:01:05 | 显示全部楼层
Post by x11
select啊


if as you said, use select to specify the timeout value. in consquence, when the client send a request to the server, the server receive the request and handle it. if the process, the server is handle the request, spend a long time, which is longer the the timeout value, so the client will not wait for the response from the server.

when the client then send a request again, and then it will receive the response that the server would give at the previous time.
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表