Class used by the Main method in Program to start a new cancelalble task for each IExample implementation.
Ejemplo n.º 1
0
        /// <summary>
        /// To run an example set, uncomment the corresponding block of code.
        /// </summary>
        /// <param name="args">The program arguments.</param>
        public static void Main(string[] args)
        {
            var url       = "ws://localhost:8080";
            var secureUrl = "wss://localhost:8080";

            using (var runner = new ExampleRunner()) {
                /// Start JSON topic examples
                //runner.Start( new PublishingJSONTopics(), secureUrl );
                //runner.Start( new ConsumingJSONTopics(), url );

                /// Start string topic examples
                //runner.Start( new PublishingStringTopics(), secureUrl );
                //runner.Start( new ConsumingStringTopics(), url );

                /// Start integer topic examples
                //runner.Start( new PublishingIntegerTopics(), secureUrl );
                //runner.Start( new ConsumingIntegerTopics(), url );

                /// Start double topic examples
                //runner.Start( new PublishingDoubleTopics(), secureUrl );
                //runner.Start( new ConsumingDoubleTopics(), url );

                /// Start binary topic examples
                //runner.Start( new PublishingBinaryTopics(), secureUrl );
                //runner.Start( new ConsumingBinaryTopics(), url );

                /// Start RecordV2 topic examples
                //runner.Start( new PublishingRecordV2Topics(), secureUrl );
                //runner.Start( new ConsumingRecordV2Topics(), url );

                /// Start messaging examples
                //runner.Start( new ReceivingMessages(), secureUrl );
                //runner.Start( new SendingMessages(), secureUrl );

                /// Start Request/Response to path examples
                //runner.Start( new ReceivingPathRequestMessages(), secureUrl );
                //runner.Start( new SendingPathRequestMessages(), secureUrl );

                /// Start Request/Response to session filter examples
                //runner.Start( new ReceivingFilterRequestMessages(), secureUrl );
                //runner.Start( new SendingFilterRequestMessages(), secureUrl );

                /// Start Request/Response to specified session examples
                //runner.Start( new ReceivingSessionRequestMessages(), secureUrl );
                //runner.Start( new SendingSessionRequestMessages(), secureUrl );

                /// Start ping example
                //runner.Start( new PingServer(), url );
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// To run an example set, uncomment the corresponding block of code.
        /// </summary>
        /// <param name="args"></param>
        public static void Main( string[] args )
        {
            var runner = new ExampleRunner();

            /// Start JSON Topic Examples
            //runner.StartExample( new UpdatingJSONTopics(), "wss://localhost:8443" );
            //runner.StartExample( new ConsumingJSONTopics(), "ws://localhost:8080" );

            /// Start Record Topic Examples
            runner.StartExample( new UpdatingRecordTopics(), "wss://localhost:8443" );
            runner.StartExample( new ConsumingRecordTopics(), "ws://localhost:8080" );

            runner.AwaitCancellation();
        }