一个现有的连接被强行关闭远程主机 [英] An existing connection was forcibly closed by the remote host

查看:2629
本文介绍了一个现有的连接被强行关闭远程主机的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个商业应用程序,它抛出SocketException异常的消息,

I am working with a commercial application which is throwing a SocketException with the message,

这是现有的连接被强行关闭远程主机

An existing connection was forcibly closed by the remote host

这发生在客户端和服务器之间的套接字连接。连接是活得很好,并且数据堆被转移,但随后被断开无章可循。

This happens with a socket connection between client and server. The connection is alive and well, and heaps of data is being transferred, but it then becomes disconnected out of nowhere.

有没有人见过这个?还有什么原因呢?我可以种猜测的几个原因,但也没有什么办法来增加更多的进入这个code摸出什么原因可能是?

Has anybody seen this before? What could the causes be? I can kind of guess a few causes, but also is there any way to add more into this code to work out what the cause could be?

任何意见/想法,欢迎。谢谢你。

Any comments / ideas are welcome. Thanks.

...最新...

我有一些.NET跟踪一些日志记录,

I have some logging from some .NET tracing,

System.Net.Sockets Verbose: 0 : [8188] Socket#30180123::Send() DateTime=2010-04-07T20:49:48.6317500Z

System.Net.Sockets Error: 0 : [8188] Exception in the Socket#30180123::Send - An existing connection was forcibly closed by the remote host DateTime=2010-04-07T20:49:48.6317500Z 

System.Net.Sockets Verbose: 0 : [8188] Exiting Socket#30180123::Send() -> 0#0

根据我所看到的事实记录的其他部分

,它说,'0#0是指0字节长度的数据包被发送。但是,这究竟意味着什么呢?

Based on other parts of the logging I have seen the fact that it says '0#0' means a packet of 0 bytes length is being sent. But what does that really mean?

一两种可能性正在发生,我不知道哪个,

One of two possibilities is occuring, and I am not sure which,

1)该连接正被关闭,但数据随后被写入到插座,因此形成上述的异常。 0#0简单的说就是什么也没有发送,因为套接字已经关闭。

1) The connection is being closed, but data is then being written to the socket, thus creating the exception above. The 0#0 simply means that nothing was sent because the socket was already closed.

2)的连接仍然是开放的,而零字节的数据包被发送(即code的一个错误)和0#0表示零字节的数据包正在试图发送。

2) The connection is still open, and a packet of zero bytes is being sent (i.e. the code has a bug) and the 0#0 means that a packet of zero bytes is trying to be sent.

你怎么算?这可能是不确定的我猜,但也许其他人看到这种事情?

What do you reckon? It might be inconclusive I guess, but perhaps someone else has seen this kind of thing?

推荐答案

这通常意味着远程端通过发送一个TCP关闭连接(通常是/ IP RST 包)。如果你使用的是第三方应用程序,可能的原因是:

This generally means that the remote side closed the connection (usually by sending a TCP/IP RST packet). If you're working with a third-party application, the likely causes are:

  • 您发送畸形数据到应用程序
  • 在客户端和服务器之间的网络连接会因为某些原因
  • 您已经触发了,导致它崩溃了第三方应用程序中的错误
  • 的第三方应用已经耗尽系统资源

这可能是因为第一种情况是发生了什么。

It's likely that the first case is what's happening.

您可以火起来 Wireshark的来看看到底发生了什么的线缩小的问题。

You can fire up Wireshark to see exactly what is happening on the wire to narrow down the problem.

如果没有更具体的信息,这是不可能的,任何人都可以在这里真正帮助你了。

Without more specific information, it's unlikely that anyone here can really help you much.

这篇关于一个现有的连接被强行关闭远程主机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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