如何应对失去socketexcrption连接 [英] how to deal with socketexcrption connection lost

查看:284
本文介绍了如何应对失去socketexcrption连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我得到socketexception,在服务器端告诉连接复位。发生这种情况时,客户端失去了与服务器的连接并重新连接。

I get socketexception that tell "connection reset" in the server side. this happen when Client side lost the connection to the server and re- connect.

什么可能我做的修理插座。如何把它发生后,处理这个异常...
修改我的问题并不需要code,我询问处理socketexception的概念,套接字已关闭或连接复位。 我应该连接到服务器的所有时间应用程序,我们知道,在应用程序的生命随时注册客户端将失去互联网接入。那么这个异常会火。
我怎么可以让客户端重新连接!!

what may I do to "fix" the socket. how to handle this Exception after it occur ... EDIT my question not need code, I ask about the concept of dealing with socketexception, the socket already closed or connection reset. my application supposed to be connected to the server all the time, we know that in any time of the app life the Registered client will lost the Internet access. then this exception will fire. How may I let the Client to reconnect!!

推荐答案

我们的想法是的修正错误的导致它发生。的之后的正好有什么可以除了关闭套接字做。它通常是由书面形式向已经关闭B上的对等连接。换句话说,应用协议错误

The idea is to fix the bug that causes it to happen. After it happens there is nothing you can do except close the socket. It's usually caused by writing to a connection that had already been closed b the peer: in other words, an application protocol error.

这篇关于如何应对失去socketexcrption连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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