"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "html/muscle-by-example/examples/signalhandlersession/example_2_custom_handling.cpp" between
muscle8.20.zip and muscle8.30.zip

About: MUSCLE (Multi User Server Client Linking Environment) is a messaging server and networking API. The included server program ("muscled") lets its clients message each other, and/or store information in its serverside hierarchical database.

example_2_custom_handling.cpp  (muscle8.20):example_2_custom_handling.cpp  (muscle8.30)
skipping to change at line 53 skipping to change at line 53
SetConsoleLogLevel(MUSCLE_LOG_DEBUG); SetConsoleLogLevel(MUSCLE_LOG_DEBUG);
// This object contains our server's event loop. // This object contains our server's event loop.
ReflectServer reflectServer; ReflectServer reflectServer;
// This factory will create a StorageReflectSession object whenever // This factory will create a StorageReflectSession object whenever
// a TCP connection is received on SMART_SERVER_TCP_PORT, and // a TCP connection is received on SMART_SERVER_TCP_PORT, and
// attach the StorageReflectSession to the ReflectServer for use. // attach the StorageReflectSession to the ReflectServer for use.
StorageReflectSessionFactory smartSessionFactory; StorageReflectSessionFactory smartSessionFactory;
status_t ret; status_t ret;
if (reflectServer.PutAcceptFactory(SMART_SERVER_TCP_PORT, ReflectSessionFacto ryRef(&smartSessionFactory, false)).IsError(ret)) if (reflectServer.PutAcceptFactory(SMART_SERVER_TCP_PORT, DummyReflectSession FactoryRef(smartSessionFactory)).IsError(ret))
{ {
LogTime(MUSCLE_LOG_CRITICALERROR, "Couldn't bind to TCP port %u! (Perhaps a copy of this program is already running?) [%s]\n", SMART_SERVER_TCP_PORT, ret ()); LogTime(MUSCLE_LOG_CRITICALERROR, "Couldn't bind to TCP port %u! (Perhaps a copy of this program is already running?) [%s]\n", SMART_SERVER_TCP_PORT, ret ());
return 5; return 5;
} }
MySignalHandlerSession signalHandlerSession; MySignalHandlerSession signalHandlerSession;
if (reflectServer.AddNewSession(AbstractReflectSessionRef(&signalHandlerSessi on, false)).IsError(ret)) if (reflectServer.AddNewSession(DummyAbstractReflectSessionRef(signalHandlerS ession)).IsError(ret))
{ {
LogTime(MUSCLE_LOG_ERROR, "Unable to add SignalHandlerSession, aborting! [ %s]\n", ret()); LogTime(MUSCLE_LOG_ERROR, "Unable to add SignalHandlerSession, aborting! [ %s]\n", ret());
return 10; return 10;
} }
LogTime(MUSCLE_LOG_INFO, "example_2_custom_handling is listening for incoming TCP connections on port %u\n", SMART_SERVER_TCP_PORT); LogTime(MUSCLE_LOG_INFO, "example_2_custom_handling is listening for incoming TCP connections on port %u\n", SMART_SERVER_TCP_PORT);
LogTime(MUSCLE_LOG_INFO, "Try pressing Control-C (or doing a \"kill -s SIGINT this_process_id\" in another Terminal) to see this process react to the signal. \n"); LogTime(MUSCLE_LOG_INFO, "Try pressing Control-C (or doing a \"kill -s SIGINT this_process_id\" in another Terminal) to see this process react to the signal. \n");
LogTime(MUSCLE_LOG_INFO, "\n"); LogTime(MUSCLE_LOG_INFO, "\n");
// Our server's event loop will run here -- ServerProcessLoop() will not retu rn until it's time for the server to exit // Our server's event loop will run here -- ServerProcessLoop() will not retu rn until it's time for the server to exit
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)