Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用 HttpWebRequest.BeginGetRequestStream 向远程服务器发出 POST 请求。我们假设在这个过程中网络连接丢失并且没有收到响应。有什么方法可以检测请求是否发送到远程服务器?谢谢!
没有任何响应,就无法知道服务器接收和处理了什么。您需要在应用程序层处理此问题,并使用您确实收到其响应的另一个请求。
也就是说,您将检测到连接丢失并且您没有收到响应,因此您的应用程序发送另一个请求,或者重复相同的请求(服务器必须正确处理)或发送查询“您收到了吗?使用事务 ID XYZ 处理该请求?”。