当前位置: 技术问答>linux和unix
套接字编程客户端服务器 阻塞模型 传送1M数据出问题
来源: 互联网 发布时间:2017-05-23
本文导语: 1 客户端A socket1 write 1M to 服务器 写成功 2 客户端A socket2 write 1M to 服务器 写返回 write error : Resource temporarily unavailable 3 服务器从 sevsocketfd1 read 1M成功 4 服务器从 sevsocketfd2 read 一直阻塞 问题到底出来...
1 客户端A socket1 write 1M to 服务器 写成功
2 客户端A socket2 write 1M to 服务器 写返回 write error : Resource temporarily unavailable
3 服务器从 sevsocketfd1 read 1M成功
4 服务器从 sevsocketfd2 read 一直阻塞
问题到底出来哪儿呢?百思不得其解。
这个程序是在一台机子上跑的,通过回环网络测试的(127.0.0.1)。
|
试试write之前select一下
|
did socket1 and socket2 read/write at the same time. How did you implement the server?
Have you checked the error message?
Is it EAGAIN if read/write is O_NONBLOCK?
Did you set up a non-default timeout?
Have you checked the error message?
Is it EAGAIN if read/write is O_NONBLOCK?
Did you set up a non-default timeout?
您可能感兴趣的文章:
本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。