Thrift lesson 4 exception handling of connection interruption
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