"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "html/muscle-by-example/examples/detectnetworkconfigchangessession/example_2_without_subclassing.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_without_subclassing.cpp  (muscle8.20):example_2_without_subclassing.cpp  (muscle8.30)
skipping to change at line 76 skipping to change at line 76
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;
} }
DetectNetworkConfigChangesSession detectSession; DetectNetworkConfigChangesSession detectSession;
if (reflectServer.AddNewSession(AbstractReflectSessionRef(&detectSession, fal se)).IsError(ret)) if (reflectServer.AddNewSession(DummyAbstractReflectSessionRef(detectSession) ).IsError(ret))
{ {
LogTime(MUSCLE_LOG_ERROR, "Couldn't add DetectNetworkConfigChangesSession, aborting! [%s]\n", ret()); LogTime(MUSCLE_LOG_ERROR, "Couldn't add DetectNetworkConfigChangesSession, aborting! [%s]\n", ret());
return 10; return 10;
} }
MyRandomSession mySession; MyRandomSession mySession;
if (reflectServer.AddNewSession(AbstractReflectSessionRef(&mySession, false)) .IsError(ret)) if (reflectServer.AddNewSession(DummyAbstractReflectSessionRef(mySession)).Is Error(ret))
{ {
LogTime(MUSCLE_LOG_ERROR, "Couldn't add MyRandomSession, aborting! [%s]\n" , ret()); LogTime(MUSCLE_LOG_ERROR, "Couldn't add MyRandomSession, aborting! [%s]\n" , ret());
return 10; return 10;
} }
LogTime(MUSCLE_LOG_INFO, "example_2_without_subclassing is listening for inco ming TCP connections on port %u\n", SMART_SERVER_TCP_PORT); LogTime(MUSCLE_LOG_INFO, "example_2_without_subclassing is listening for inco ming TCP connections on port %u\n", SMART_SERVER_TCP_PORT);
LogTime(MUSCLE_LOG_INFO, "Try modifying your computer's Network Settings, or putting your computer to sleep!\n"); LogTime(MUSCLE_LOG_INFO, "Try modifying your computer's Network Settings, or putting your computer to sleep!\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. 3 change blocks. 
3 lines changed or deleted 3 lines changed or added

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