Windows中的C#tcp协议连接。服务器应用程序崩溃会发生什么 [英] C# tcp protocol connection in Windows. What happens if server application crash?

查看:517
本文介绍了Windows中的C#tcp协议连接。服务器应用程序崩溃会发生什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我使用tcp协议创建服务器应用程序然后与客户端应用程序建立连接但服务器崩溃然后客户端发送数据会发生什么情况。数据会丢失还是系统会继续尝试发送数据?

What happens if I make a server application using tcp protocol and then establish connection with a client application but the server crash and then the client send data. Will the data be lost or the system will continue trying to send it?

推荐答案

'系统'?否..如果服务器崩溃,套接字将(可能在超时后)关闭,在哪个阶段客户端应检测到连接已关闭并自行采取恢复操作。因此,您的客户应在识别断开连接时,实施自己的协议以尝试重新建立连接并重新发送数据
'the system' ? no .. if the server crashes, the socket will (possibly after a timeout) be closed, at which stage the client should detect that the connection has been closed and take recovery action on its own. So, your client should, on recognising a disconnect, implement its own protocol for trying to re-establish the connection and re-send the data


这篇关于Windows中的C#tcp协议连接。服务器应用程序崩溃会发生什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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