Exemple #1
0
        protected override void OnStart(string[] args)
        {
            System.Net.ServicePointManager.DefaultConnectionLimit = 10;

            // Start client and server threads now
            ClientThread.Start();
        }
        /// <summary>
        /// Prevents a default instance of the <see cref="Application" /> class from being created.
        /// Initializes default values of the class instance.
        /// </summary>
        private Application()
        {
            // Register service with unique identifier
            // uncomment this to enable debug output

            /*
             * System.IO.FileStream myTraceLog = new
             * System.IO.FileStream("myTraceLog.txt",
             * System.IO.FileMode.OpenOrCreate);
             * // Creates the new trace listener.
             * System.Diagnostics.TextWriterTraceListener myListener =
             *  new System.Diagnostics.TextWriterTraceListener(myTraceLog);
             * Debug.Listeners.Add(myListener);
             */
            Debug.WriteLine("Starting the Push Service, before setting it is : " + System.Net.ServicePointManager.DefaultConnectionLimit + " at " + DateTime.Now.ToString());
            this.ServiceGuid = new Guid(Application.Guid);

            System.Net.ServicePointManager.DefaultConnectionLimit = 10;

            // Start client and server threads now
            ClientThread.Start();
            ///ServerThread.Start();
        }