当前位置: 首页 > news >正文

网站后台语言全网推广系统

网站后台语言,全网推广系统,云南微网站建设的公司有哪些,软件研发项目管理系统今天开发网络模型,又遇到了10054的错误,这是之前已经遇到过,但是一直没有处理,今天在网上查找方案,看到一篇帖子,觉得有点道理,拷贝下来,大家参详一二,希望大牛给出正确的…

今天开发网络模型,又遇到了10054的错误,这是之前已经遇到过,但是一直没有处理,今天在网上查找方案,看到一篇帖子,觉得有点道理,拷贝下来,大家参详一二,希望大牛给出正确的解释。帖子是英文,大概意思我明白,不过翻译不太好,原帖奉上。

问题描述:

 I have a C/S program. Client use socket to send a file to server, after send approximate more than 700k data, client(on win7) will receive a socket 10054 error which means Connection reset by peer.

Server worked on CentOS 5.4, client is windows7 virtual machine run in virtual box. client and server communicate via a virtual network interface. The command port(send log) is normal, but the data port(send file) have the problem. If it was caused by wrong configuration of socket buffer size or something else? If anyone can help me check the problem. Thanks.

Every time I call socket send a buffer equals 4096 byte send(socket, buffer, 4096, 0 )

CentOS socket config.



down vote favorite


#sysctl -a
...
net.ipv4.tcp_rmem = 4096        87380   4194304
net.ipv4.tcp_wmem = 4096        16384   4194304
net.ipv4.tcp_mem = 196608       262144  393216
net.ipv4.tcp_dsack = 1
net.ipv4.tcp_ecn = 0
net.ipv4.tcp_reordering = 3
net.ipv4.tcp_fack = 1



I'm not quite understand what the socket buffer configuration means, if this will cause the receive incomplete result problem?

解答:


down vote accepted

It's almost definitely a bug in your code. Most likely, one side thinks the other side has timed out and so closes the connection abnormally. The most common way this happens it that you call a receive function to get data, but you actually already got that data and just didn't realize it. So you're waiting for data that you have already received and thus time out.

For example:

1) Client sends a message.

2) Client sends another message.

3) Server reads both messages but thinks it only got one, sends an acknowledge.

4) Client receives acknowledge, waits for second acknowledge which server will never send.

5) Server waits for second message which it actually already received.

Now the server is waiting for the client and the client is waiting for the server. The server was coded incorrectly and didn't realize that it actually got two messages in one go. TCP does not preserve message boundaries.

If you tell me more about your protocol, I can probably tell you in more detail what went wrong. What constitutes a message? Which side sends when? Are there any acknowledgements? And so on.

But the short version is that each side is probably waiting for the other.

Most likely, the connection reset by peer is a symptom. Your problem occurs, one side times out and aborts the connection. That causes the other side to get a connection reset because the other side aborted the connection.


2 down vote favorite

I have a C/S program. Client use socket to send a file to server, after send approximate more than 700k data, client(on win7) will receive a socket 10054 error which means Connection reset by peer.

Server worked on CentOS 5.4, client is windows7 virtual machine run in virtual box. client and server communicate via a virtual network interface. The command port(send log) is normal, but the data port(send file) have the problem. If it was caused by wrong configuration of socket buffer size or something else? If anyone can help me check the problem. Thanks.

Every time I call socket send a buffer equals 4096 byte send(socket, buffer, 4096, 0 )

CentOS socket config.

4 down vote accepted

It's almost definitely a bug in your code. Most likely, one side thinks the other side has timed out and so closes the connection abnormally. The most common way this happens it that you call a receive function to get data, but you actually already got that data and just didn't realize it. So you're waiting for data that you have already received and thus time out.

For example:

1) Client sends a message.

2) Client sends another message.

3) Server reads both messages but thinks it only got one, sends an acknowledge.

4) Client receives acknowledge, waits for second acknowledge which server will never send.

5) Server waits for second message which it actually already received.

Now the server is waiting for the client and the client is waiting for the server. The server was coded incorrectly and didn't realize that it actually got two messages in one go. TCP does not preserve message boundaries.

If you tell me more about your protocol, I can probably tell you in more detail what went wrong. What constitutes a message? Which side sends when? Are there any acknowledgements? And so on.

But the short version is that each side is probably waiting for the other.

Most likely, the connection reset by peer is a symptom. Your problem occurs, one side times out and aborts the connection. That causes the other side to get a connection reset because the other side aborted the connection.

http://www.tj-hxxt.cn/news/19951.html

相关文章:

  • 网站开发人员上级主管域名查询万网
  • 旅游网站源码seo经理
  • 企业自建服务器网站建设流程抖音搜索引擎优化
  • 惠州专业做网站如何做互联网营销推广
  • 网站在百度上做推广怎样做怎么做产品推广平台
  • 成品网站w灬 源码1688三叶草生成关键词的软件
  • 山东网站建设公司标题优化
  • 新东方培训机构官网我赢seo
  • hbuilder做的网站seog
  • 在线视频播放网站建设整站优化加盟
  • 上海网站制作费用百度普通版下载
  • 比分网站怎么做营销qq
  • 网站建设需求说明书模板企业网站seo方案
  • 建网站域名怎么买站长工具友链检测
  • 江门做网站公司百度一下就知道官方网站
  • 电商网站 建设步骤站长工具精华
  • 做网站app要注册哪类商标职业教育培训机构排名前十
  • 网页制作个人简历的代码搜索引擎优化的流程
  • 东营网站建设公司网络营销技巧
  • 网络营销方式可分为无站点网络营销和什么武汉官网优化公司
  • 成都专业网站建设公司排名太原百度公司地址
  • 如何新建网站徐州百度seo排名优化
  • 做非法集资资讯的网站自己做网站怎么做
  • 网站开发现成日历控件微信搜一搜怎么做推广
  • 网站备份信息广告投放价目表
  • 网站怎么做地图导航常州百度seo排名
  • 使用WordPress快速建站视频谷歌seo优化排名
  • 织梦网站建设实训总结网站优化课程
  • 常德做网站的公司手机优化大师哪个好
  • 机票网站建设网站流量统计分析的维度包括