Exemplo n.º 1
0
        internal static void Initialize()
        {
            TasksQueueStatic     = new CommonLibs.Utils.Tasks.TasksQueue();
            ConnectionListStatic = new CommonLibs.Web.LongPolling.ConnectionList(TasksQueueStatic);
            MessageHandlerStatic = new CommonLibs.Web.LongPolling.MessageHandler(TasksQueueStatic, ConnectionListStatic);

                        #if DEBUG
            // Increase stale & disconnection timeouts during development so unwanted disconnections don't occures when using breakpoints
            ConnectionListStatic.DisconnectionSeconds   = 60 * 60;                  // 1H
            ConnectionListStatic.StaleConnectionSeconds = 60 * 60;                  // 1H
                        #endif

            // Registering message handlers
            MessageHandlerStatic.AddMessageHandler(SiteMaster.PingMessageType, SiteMaster.PingMessageHandler);
            MessageHandlerStatic.AddMessageHandler("Test01_TestCrash", Test01Crash.TestCrashHandler);
        }
Exemplo n.º 2
0
        internal static void Initialize()
        {
            TasksQueueStatic = new CommonLibs.Utils.Tasks.TasksQueue();
            ConnectionListStatic = new CommonLibs.Web.LongPolling.ConnectionList( TasksQueueStatic );
            MessageHandlerStatic = new CommonLibs.Web.LongPolling.MessageHandler( TasksQueueStatic, ConnectionListStatic );

            #if DEBUG
                // Increase stale & disconnection timeouts during development so unwanted disconnections don't occures when using breakpoints
                ConnectionListStatic.DisconnectionSeconds = 60*60;  // 1H
                ConnectionListStatic.StaleConnectionSeconds = 60*60;  // 1H
            #endif

            // Registering message handlers
            MessageHandlerStatic.AddMessageHandler( SiteMaster.PingMessageType, SiteMaster.PingMessageHandler );
            MessageHandlerStatic.AddMessageHandler( "Test01_TestCrash", Test01Crash.TestCrashHandler );
        }
Exemplo n.º 3
0
            internal MessageContext(MessageHandler messageHandler, CallbackItem callbackItem, Message message)
            {
                MessageHandler = messageHandler;
                CallbackItem = callbackItem;
                Message = message;

                if( MessageHandler.SaveMessageContextObject != null )
                    try { ContextObject = MessageHandler.SaveMessageContextObject(); }
                    catch( System.Exception ex )  { MessageHandler.FAIL( "'MessageHandler.SaveMessageContextObject()' threw an exception (" + ex.GetType().FullName + "): " + ex.Message ); }
                else
                    ContextObject = null;
            }