当前位置: 首页 > 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.yayakq.cn/news/179312/

相关文章:

  • 企业网站建设及运营现状分析湛江定制建站企业网站
  • wordpress网站地图企业网站如何做seo
  • 3网站建设公司wordpress局域网404
  • 天津建设科技杂志的官方网站百度推广做的网站可以用吗
  • 网站方案建设书怎么写建筑业管理平台登录
  • 网站建立连接不安全怎么处理成都网站建设兼职
  • 兰州酒店网站建设武安市城乡建设局网站
  • 我做动作你来猜的网站阿里云外贸建站
  • 网站页面标题设置网络推广合作平台
  • wordpress后台排版错乱怎么做企业网站优化
  • 站长工具大全微网站是什么
  • 天津优化网站哪家好用可以做兼职的网站有哪些工作室
  • 传奇广告查询网站做网站公司昆明
  • 网站 网络营销价值学校网页设计方案
  • 西安建设网站首页公司网页设计文案
  • 广东宏昌建设有限公司网站搜资源
  • 销售产品单页面网站推荐几个做网页设计的网站
  • 校园网二级网站的建设电子商务网站建设维护
  • 网站搭建哪家比较好网站界面分析
  • 三门峡高端网站建设企业运营管理平台
  • 手机上怎么制作网站吗网站找哪些单位做实名认证
  • 广州自适应网站建设济南市新闻最新消息
  • 什么叫网站的域名网站建设方案编写人
  • 湖北网站建设软件有哪些网页模板网站都有什么作用
  • 怎样做网站推广啊视频个人网站的前途
  • 晋城网站设计人免费的国外服务器
  • 怎么把做的网页放入网站微信公众平台和微网站的区别
  • dede投票类网站源码wordpress连接微博专业版
  • 以应用为导向的高职高专数学课程改革与建设 教学成果奖申报网站中文网站后台
  • 谷歌优化网站链接怎么做六盘水网站开发