Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Thrift lesson 4 exception handling of connection interruption

2025-03-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/03 Report--

Scene

The Thrift framework uses exception handling mechanism. When the client disconnects abnormally and the server tries to send data to the client at this time, the Thrift library will throw an exception, resulting in process interruption. This situation is very normal, the server side should catch the occurrence of the exception, but should not exit the exception.

The exception is caught in the thread called by the user, so there is no need to modify the code

Catch (const TTransportException& ttx)

{

/ / all exceptions thrown by the Thrift framework will be returned directly

Std::cout

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report