本文介绍了Indy-知道调制解调器何时发送了RESET [RST]标志的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我注意到当我正在与之交谈的设备发送RESET响应时,我收到ElastSocketError消息,其LastError = 10054或10053。给定10054是对等连接重置,这很有意义。

I have noticed that I receive an EIdSocketError with LastError = 10054 or 10053 when the device I'm talking to sends a RESET response. Which makes sense, given 10054 is Connection Reset By Peer.

那么我有什么可以检查Indy的内容,而不是将代码包装在try / except块中并查找10054或10053错误代码吗?

So is there anything I can check in Indy to determine if this has ocurred rather than wrapping my code in try/except block and looking for 10054 or 10053 error codes?

我遇到的一种情况是,连接后调制解调器回复了RESET答复(Indy没有引发异常),所以从我的角度来看,连接成功了。然后,我尝试写入套接字(即使用TidTCPClient发送数据包),并引发10054错误。

One scenario I encountered was the modem replied with a RESET reply after I connected (Indy didn't raise an exception) so from my point of view the connection succeeded. I then attempted to write to the socket (ie send a packet using TidTCPClient) and the 10054 error was raised.

是否有可能完全看到此RESET回复?

Is it possible to see this RESET reply at all?

谢谢

推荐答案

使用 try ..除了是正确的方法。 Indy通过异常进行沟通。在Indy看来,即使连接正常关闭也是一个例外。

Using try..except is the right way. Indy communicates throught exceptions. Even 'Connection closed gracefully' is an exception in Indy's eyes.

这篇关于Indy-知道调制解调器何时发送了RESET [RST]标志的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-19 00:06