Exemplo n.º 1
0
        /// <summary>
        /// Starting the server loop that will control relay query handler.
        /// </summary>
        protected static void ThreadingServerLoop_DuplexRelay(object server)
        {
            #region Init
            Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("en-us");
            Console.WriteLine("DUPLEX RELAY THREAD STARTED: {0}", Thread.CurrentThread.Name);

            // Name of pipe server that will established.
            // Access to this pipe by clients will be available by this name.
            string serverName = ((RelayServer)server).ServerThread.Name;
            #endregion

            #region Server establishing
            // Start server loop.
            ClientToServerTransmissionController.ServerLoop(
                serverName,
                QueryHandler_DuplexRelay,
                ((RelayServer)server).pipeName,
                ((RelayServer)server).securityLevel);
            #endregion
        }
        /// <summary>
        ///  Main loop that control pipe chanel that will recive clients.
        /// </summary>
        protected static void ThreadingServerLoop_PP_Input(object server)
        {
            #region Init
            Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("en-us");
            Console.WriteLine("INPUT THREAD STARTED: {0}", Thread.CurrentThread.Name);

            // Name of pipe server that will established.
            // Access to this pipe by clients will be available by this name.
            string serverName = ((BaseServer)server).ServerThread.Name;
            #endregion

            #region Server establishing
            // Start server loop.
            ClientToServerTransmissionController.ServerLoop(
                serverName,
                PipesProvider.Handlers.Queries.ProcessingAsync,
                ((BaseServer)server).pipeName,
                ((BaseServer)server).securityLevel);
            #endregion
        }