Project

General

Profile

Typo in a header file? ยป wttest.cpp

Vincenzo Romano, 10/16/2018 10:40 AM

 
// Wt v4.0.4
#include <Wt/WServer.h>

// C++ 14 or 17
#include <csignal> // SIGHUP
#include <cstdio> // fprintf()

// C

int main( int argc, char** argv ) {
int retVal = 0;
try {
/*
WServer server( argv[0] );
server.setServerConfiguration( argc,argv,WTHTTP_CONFIGURATION );
server.addEntryPoint( Wt::Application,[]( const Wt::WEnvironment& env ) { return new Appl( env ); } );
if( server.start() ) {
int sig = Wt::WServer::waitForShutdown( argv[0] );
server.stop();
if( sig == SIGHUP ) {
Wt::WServer::restart( argc,argv,environ );
}
}
*/
}
/*
catch( Wt::WServer::Exception& exc ) {
fprintf( stderr,"Caught a Wt::WServer::Exception: %s\n",exc.what() );
retVal = 1;
}
catch( Wt::WException& exc ) {
fprintf( stderr,"Caught a Wt::WException: %s\n",exc.what() );
retVal = 2;
}
*/
catch( std::exception& exc ) {
fprintf( stderr,"Caught a std::exception: %s\n",exc.what() );
retVal = 3;
}
catch( const char* exc ) {
fprintf( stderr,"Caught a char* exception: %s\n",exc );
retVal = 4;
}
catch( ... ) {
fprintf( stderr,"Caught an unknown exception\n" );
retVal = 5;
}
fprintf( stderr,"Exiting with retVal=%d\n",retVal );
return retVal;
}

//EOF
    (1-1/1)