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

问题描述

我在服务器端程序上运行,该程序侦听连接,然后当然会处理它们.虽然连接后我仍然遇到问题.
该程序有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.

推荐答案



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

05-27 03:23
查看更多