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

旅游商城网站模板免费下载建设中网站首页

旅游商城网站模板免费下载,建设中网站首页,灰色行业seo大神,文化局网站建设方案今天开发网络模型,又遇到了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/375300/

相关文章:

  • 温州网站建设咨询python链接wordpress
  • php开发手机网站html模板免费十个网页
  • 网站做315认证吾爱源码
  • 苏州营销型网站开发公司企业网站建设犇类建筑
  • 网站建设背景朝阳企业网站建设哪家最好
  • 深圳的网站网站建设及制作
  • 公司注册核名在哪个网站做网站标题代码
  • 众筹网站搭建湖南建筑信息网平台
  • 网站侧边栏导航代码网站界面设计实训的意义
  • 网站做百度排名教程网站关键词优化方式
  • 购物网站开发历史建网站找哪个公司
  • 安庆公司做网站苏州和城乡建设局网站首页
  • 绍兴专业做网站公司重庆市建设厅官方网站
  • 门户网站开发要求wordpress 自定义文章类型 分页
  • 木鱼的网站网店交易平台网站建设
  • 容桂品牌网站建设优惠专业网站运营设计
  • 烟台网站排名优化网站seo优化分析
  • 凡科做的网站百度不到电影网站建设模板
  • 织梦网站添加广告位网页查询系统
  • 网站下载链接怎么做天猫商城网官网
  • 河北网站建设与推广活动发布类网站开发
  • 加强局网站建设多语言企业网站建设费用
  • 利用淘宝视频服务做视频网站wordpress分析类主题
  • 电影资源分享网站怎么做的交换友情链接的好处
  • 网站应用软件设计会qt怎么做网站
  • 网站建设与管理报告书兰州装修公司位置
  • 深圳极速网站建设定制没有网站怎么做seo
  • 搭建网站有哪些网站建设 提供源码
  • 分销商城网站开发北京网站建设
  • 腾讯云手动搭建wordpress个人站点高级感ppt模板