Hi everyone, 

We're using the C++ Thrift server now and I had a question. 

In the implementation of listen() for TSimpleServer and TThreaderServer: 

try { 
// Start the server listening 
serverTransport_->listen(); 
} catch (TTransportException& ttx) { 
string errStr = string("TThreadedServer::run() listen(): ") +ttx.what(); 
GlobalOutput(errStr.c_str()); 
return; 
} 

This sort of limits our error handling ability :) If for example the port is in 
use in our development environment we'd like to automatically pick a different 
port. 

I see that I might be able to specify a function pointer to GlobalOutput 
although I haven't looked in detail. That just takes a string though. 

Was the intent that packaged server classes be subclassed for error handling? 
The trouble is that for TSimpleServer and TThreadedServer, everything 
(including the call to listen()) is inside of serve(). 

Is there another way to do this? 

Thanks, 

Rob 

Reply via email to