虽然清单13中的代码看起来似乎不错,但是还有一个问题——如果服务器响应请求并完成了处理但是报告了一个错误怎么办?
Despite the apparent success of the code in Listing 13, there's still a problem — what if the server responds to your request and finishes processing, but reports an error?
例如,可能服务器获取了该消息并且正确地进行了处理,但是在试图处理响应消息的时候发生了一些错误。
As an example, perhaps the server receives the message and processes it correctly, but something goes wrong while trying to process the response message.
当接收到响应的时候,错误检查机制能够保证服务器方面成功执行了任务。
When the response is received, error checking ensures that the server succeeded.
应用推荐