internal RemoteConnection(Stream pipeIn, Stream pipeOut, bool isClient)
        {
            this.pipeIn   = pipeIn;
            this.pipeOut  = pipeOut;
            this.isClient = isClient;

            localProcessId = Process.GetCurrentProcess().Id;
            callStack      = new RemoteCallStack();

            streamHandler = new StreamHandler(pipeIn, pipeOut);

            if (!isClient)
            {
                CfxRuntime.OnCfxShutdown += new Action(CfxRuntime_OnCfxShutdown);
            }

            writer = new Thread(WriteLoopEntry);
            reader = new Thread(ReadLoopEntry);

            writer.Name = "cfx_rpc_writer";
            reader.Name = "cfx_rpc_reader";

            writer.IsBackground = true;
            reader.IsBackground = true;

            writer.Start();
            reader.Start();
        }
Esempio n. 2
0
        internal RemoteConnection(Stream pipeIn, Stream pipeOut, bool isClient)
        {
            this.pipeIn = pipeIn;
            this.pipeOut = pipeOut;
            this.isClient = isClient;

            localProcessId = Process.GetCurrentProcess().Id;
            callStack = new RemoteCallStack();

            streamHandler = new StreamHandler(pipeIn, pipeOut);

            if(!isClient) {
                CfxRuntime.OnCfxShutdown += new Action(CfxRuntime_OnCfxShutdown);
            }

            writer = new Thread(WriteLoopEntry);
            reader = new Thread(ReadLoopEntry);

            writer.Name = "cfx_rpc_writer";
            reader.Name = "cfx_rpc_reader";

            writer.IsBackground = true;
            reader.IsBackground = true;

            writer.Start();
            reader.Start();
        }