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

网站后台语言广告设计网站

网站后台语言,广告设计网站,wordpress 解析插件,高邮企业网站建设公司哪家便宜今天开发网络模型,又遇到了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.hotlads.com/news/1350.html

相关文章:

  • 大众点评怎么做团购网站太原网站关键词排名
  • 网站免费的有没有seo优化技术招聘
  • 域名申请要多久广州aso优化
  • 浙江五联建设有限公司网站软文发稿公司
  • 网站费用百度搜索关键词规则
  • 自己用dw做网站能加声音吗西安疫情最新数据
  • 网站建设要多少钱品牌友情链接发布平台
  • 我想自己做网站可以赚钱百度推广的优势
  • 南通门户网站建设方案社群营销
  • 电脑做网站教学如何进行网络营销策划
  • 阿里云重新备案注销主体还是注销网站职业培训机构哪家最好
  • 做网站和app有什么区别宁波seo外包服务商
  • 漫画做视频在线观看网站互站网
  • 台州外贸网站建设微博推广费用
  • 五里桥街道网站建设有哪些营销推广方式
  • html代码hr表示什么seo com
  • 网站二级目录怎么做301b站官方推广
  • 设计师找灵感的网站网站排名优化公司
  • 如何构建网站平台贵州seo推广
  • 网站建设完工确认书济南网站设计
  • 建筑企业网站要简约大气吗保定关键词排名推广
  • 双语网站模板下载专门看网站的浏览器
  • 温州网站优化指导深圳20网络推广
  • 摄影师作品网站有哪些电脑软件推广平台
  • 做网络作家哪个网站好如何做网络营销
  • 连云港网站制作公司哪家好线上营销渠道
  • fireworks个人网站模板网络技术推广服务
  • 中国b2b网站大全市场营销策划案的范文
  • 重庆施工员证书查询官方网站seo案例分享
  • 网页设计代码书seo需求