网络套接字异常 [英] Networking Socket Exception

查看:139
本文介绍了网络套接字异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在服务器端程序上运行,该程序侦听连接,然后当然会处理它们.虽然连接后我仍然遇到问题.
该程序有2个部分,下载文件"和上传文件".
尽管上载部分会引发以下SocketException,但下载工作仍然完美:连接尝试失败,因为一段时间后连接方未正确响应,或者连接建立失败,因为连接的主机未能响应".
它仅发生在上传端.客户端使用TcpClient和自建数据进行byte []转换.
在我连接到服务器之后,并且仅在上传文件之后(因此仅在写入字节时),就会发生这种情况.客户端关闭连接,但服务器不会收到通知,并且仍然可以将数据发送到该特定客户端,而不会引发任何异常.
有什么解释吗?

Gr,约翰内

我爸爸刚刚遇到下载问题.

I''m running on a Server side program which listens for connections and ofcourse handles them. Although after a connection is connected I face a problem.
The program has 2 sections, Download File and Upload File.
The downloading works perfect although the Upload Sections throws this SocketException: "A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond".
It ONLY happens on uploading side. The client uses TcpClient and a home-build data to byte[] convertion.
This happens AFTER I''ve connected to the server and ONLY on uploading files (Thus only on writing bytes). The Client Closes connection but the server doesn''t get notified and can still send data to that specific client with-out any Exception Getting Thrown.
Is there any explanation?

Gr, Johnnei

My dad just encountered this problem with Downloading.

推荐答案

在Google中找到相关链接

解决方案套接字错误10060连接尝试失败,因为被连接方未一段时间后正确响应,或者由于连接的主机未能响应而建立的连接失败 [解决"TCP错误代码10060:连接尝试失败…" [连接尝试失败,因为连接方未响应 [连接尝试失败,因为经过一段时间后,被连接方未正确响应或已建立连接失败,因为连接的主机无法响应 [ ^ ]
Found related links in Google

Solution socket error 10060 A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond[^]

Resolving the "TCP error code 10060: A connection attempt failed…"[^]

A connection attempt failed because the connected party did not respond[^]

A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond[^]


解决方案:
逐字节读取流字节的CPU使用率太高,导致此错误.另外,我还必须启用Net.TCP端口共享服务才能使该程序像在我的编码系统上一样工作
Solution:
The CPU Useage of reading the stream byte for byte was so intensive it caused this bug. Also I had to enable Net.TCP Port Sharing Service to make the program work as it does on my Coding System


这篇关于网络套接字异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆