当前位置: 首页>>代码示例>>C#>>正文


C# Ipc.IpcServerChannel类代码示例

本文整理汇总了C#中System.Runtime.Remoting.Channels.Ipc.IpcServerChannel的典型用法代码示例。如果您正苦于以下问题:C# IpcServerChannel类的具体用法?C# IpcServerChannel怎么用?C# IpcServerChannel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


IpcServerChannel类属于System.Runtime.Remoting.Channels.Ipc命名空间,在下文中一共展示了IpcServerChannel类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Main

		static void Main (string [] args)
		{
			IpcServerChannel channel = new IpcServerChannel ("Foo");
			ChannelServices.RegisterChannel (channel, false);
			RemotingConfiguration.RegisterWellKnownServiceType (typeof (Fooo), "Foo", WellKnownObjectMode.Singleton);
			Console.ReadLine ();
		}
开发者ID:mono,项目名称:gert,代码行数:7,代码来源:server.cs

示例2: Main

        static void Main(string[] args)
        {
            if ((args.Length == 2) && (args[0].Equals("-iphonepackager")))
            {
                // We were run as a 'child' process, quit when our 'parent' process exits
                // There is no parent-child relationship WRT windows, it's self-imposed.
                int ParentPID = int.Parse(args[1]);

                IpcServerChannel Channel = new IpcServerChannel("iPhonePackager");
                ChannelServices.RegisterChannel(Channel, false);
                RemotingConfiguration.RegisterWellKnownServiceType(typeof(DeploymentImplementation), "DeploymentServer_PID" + ParentPID.ToString(), WellKnownObjectMode.Singleton);

                Process ParentProcess = Process.GetProcessById(ParentPID);
                while (!ParentProcess.HasExited)
                {
                    System.Threading.Thread.Sleep(1000);
                }
            }
            else
            {
                // Run directly by some intrepid explorer
                Console.WriteLine("Note: This program should only be started by iPhonePackager");
                Console.WriteLine("  This program cannot be used on it's own.");

                DeploymentImplementation Deployer = new DeploymentImplementation();
                var DeviceList = Deployer.EnumerateConnectedDevices();
                foreach (var Device in DeviceList)
                {
                    Console.WriteLine("  - Found device named {0} of type {1} with UDID {2}", Device.DeviceName, Device.DeviceType, Device.UDID);
                }

                Console.WriteLine("Exiting.");
            }
        }
开发者ID:Tigrouzen,项目名称:UnrealEngine-4,代码行数:34,代码来源:Program.cs

示例3: EntryPoint

        public EntryPoint(
            EasyHook.RemoteHooking.IContext context,
            String channelName,
            CaptureConfig config)
        {
            // Get reference to IPC to host application
            // Note: any methods called or events triggered against _interface will execute in the host process.
            _interface = EasyHook.RemoteHooking.IpcConnectClient<CaptureInterface>(channelName);

            // We try to ping immediately, if it fails then injection fails
            _interface.Ping();

            #region Allow client event handlers (bi-directional IPC)
            
            // Attempt to create a IpcServerChannel so that any event handlers on the client will function correctly
            System.Collections.IDictionary properties = new System.Collections.Hashtable();
            properties["name"] = channelName;
            properties["portName"] = channelName + Guid.NewGuid().ToString("N"); // random portName so no conflict with existing channels of channelName

            System.Runtime.Remoting.Channels.BinaryServerFormatterSinkProvider binaryProv = new System.Runtime.Remoting.Channels.BinaryServerFormatterSinkProvider();
            binaryProv.TypeFilterLevel = System.Runtime.Serialization.Formatters.TypeFilterLevel.Full;

            System.Runtime.Remoting.Channels.Ipc.IpcServerChannel _clientServerChannel = new System.Runtime.Remoting.Channels.Ipc.IpcServerChannel(properties, binaryProv);
            System.Runtime.Remoting.Channels.ChannelServices.RegisterChannel(_clientServerChannel, false);
            
            #endregion
        }
开发者ID:Csharper1972,项目名称:Direct3DHook,代码行数:27,代码来源:EntryPoint.cs

示例4: EyesarServer

 protected EyesarServer(EyesarSharedObject sharedObject)
 {
     if (ChannelServices.RegisteredChannels.Any(channel => channel.ChannelName == "Eyesar"))
         throw new InvalidOperationException();
     _channel = new IpcServerChannel("Eyesar", "eyesar");
     ChannelServices.RegisterChannel(_channel, false);
     RemotingServices.Marshal(SharedObject = sharedObject, "shared", typeof (EyesarSharedObject));
 }
开发者ID:theoxuan,项目名称:Remoting,代码行数:8,代码来源:EyesarServer.cs

示例5: PtAccServer

 public PtAccServer()
 {
     // Create and register an IPC channel
     serverChannel = new IpcServerChannel("remote");
     ChannelServices.RegisterChannel(serverChannel, true);
     // Expose an object
     RemotingConfiguration.RegisterWellKnownServiceType(typeof(PtAccRemoteType), "PtAcc", WellKnownObjectMode.Singleton);
 }
开发者ID:Raggles,项目名称:HC.PtAcc,代码行数:8,代码来源:PtAccServer.cs

示例6: RegisterIpcChannel

      public static void RegisterIpcChannel(EventHandler<NewInstanceDetectedEventArgs> handler)
      {
         IChannel ipcChannel = new IpcServerChannel(String.Format(CultureInfo.InvariantCulture, "hfm-{0}-{1}", Environment.UserName, AssemblyGuid));
         ChannelServices.RegisterChannel(ipcChannel, false);

         var obj = new IpcObject(handler);
         RemotingServices.Marshal(obj, ObjectName);
      }
开发者ID:harlam357,项目名称:hfm-net,代码行数:8,代码来源:SingleInstanceHelper.cs

示例7: Start

        public static Server Start(ApplicationCore applicationCore)
        {
            var serverChannel = new IpcServerChannel("SassTray");
            ChannelServices.RegisterChannel(serverChannel, true);
            var server = new Server(applicationCore);
            RemotingServices.Marshal(server, "Server", typeof(Server));

            return server;
        }
开发者ID:mayuki,项目名称:SassTray,代码行数:9,代码来源:Server.cs

示例8: StartServer

		static void StartServer(AssemblyService service, string name, string uri) {
			var props = new Hashtable();
			props["portName"] = name;
			var provider = new BinaryServerFormatterSinkProvider();
			provider.TypeFilterLevel = System.Runtime.Serialization.Formatters.TypeFilterLevel.Full;
			var channel = new IpcServerChannel(props, provider);
			ChannelServices.RegisterChannel(channel, false);
			RemotingServices.Marshal(service, uri);
		}
开发者ID:SAD1992,项目名称:justdecompile-plugins,代码行数:9,代码来源:AssemblyServer.cs

示例9: Main

        static void Main(string[] args)
        {
            if (args == null)
                throw new ArgumentNullException("args");

            if (args.Length != 1)
                throw new ArgumentException("Arguments number doesn't match!", "args");

            var name = args[0];

            if (string.IsNullOrEmpty(name))
                throw new Exception("Name cannot be null or empty.");

            name = name.Trim('"');

            var channelPort = string.Format(ProcessAppConst.PortNameTemplate, name, Process.GetCurrentProcess().Id);

            var currentDomain = AppDomain.CurrentDomain;
            var root = Path.Combine(Path.Combine(currentDomain.BaseDirectory, ProcessAppConst.WorkingDir), name);

            //Hack to change the default AppDomain's root
            if (NDockEnv.IsMono) //for Mono
            {
                var pro = typeof(AppDomain).GetProperty("SetupInformationNoCopy", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.GetProperty);
                var setupInfo = (AppDomainSetup)pro.GetValue(currentDomain, null);
                setupInfo.ApplicationBase = root;
            }
            else // for .NET
            {
                currentDomain.SetData("APPBASE", root);
            }

            currentDomain.SetData(typeof(IsolationMode).Name, IsolationMode.Process);

            try
            {
                var serverChannel = new IpcServerChannel("IpcAgent", channelPort, new BinaryServerFormatterSinkProvider { TypeFilterLevel = TypeFilterLevel.Full });
                var clientChannel = new IpcClientChannel();
                ChannelServices.RegisterChannel(serverChannel, false);
                ChannelServices.RegisterChannel(clientChannel, false);
                RemotingConfiguration.RegisterWellKnownServiceType(typeof(ManagedAppWorker), ProcessAppConst.WorkerRemoteName, WellKnownObjectMode.Singleton);

                Console.WriteLine("Ok");

                var line = Console.ReadLine();

                while (!"quit".Equals(line, StringComparison.OrdinalIgnoreCase))
                {
                    line = Console.ReadLine();
                }
            }
            catch
            {
                Console.Write("Failed");
            }
        }
开发者ID:huoxudong125,项目名称:NDock,代码行数:56,代码来源:Program.cs

示例10: ListenForLaunches

        public void ListenForLaunches()
        {
            if (!IsFirstInstance)
            {
                throw new InvalidOperationException();
            }

            IpcServerChannel channel = new IpcServerChannel(ApplicationId);
            ChannelServices.RegisterChannel(channel, true);

            RemotingServices.Marshal(this, ApplicationId, typeof (IFirstInstanceServer));
        }
开发者ID:LiDamon,项目名称:smtp4dev,代码行数:12,代码来源:SingleInstanceManager.cs

示例11: ProcessBootstrap

        static ProcessBootstrap()
        {
            // Create the channel.
            var clientChannel = new IpcClientChannel();
            // Register the channel.
            System.Runtime.Remoting.Channels.ChannelServices.RegisterChannel(clientChannel, false);

            var serverChannel = new IpcServerChannel("Bootstrap", BootstrapIpcPort);
            System.Runtime.Remoting.Channels.ChannelServices.RegisterChannel(serverChannel, false);

            RemotingConfiguration.RegisterWellKnownServiceType(typeof(ProcessBootstrapProxy), "Bootstrap.rem", WellKnownObjectMode.Singleton);
        }
开发者ID:hjlfmy,项目名称:SuperSocket,代码行数:12,代码来源:ProcessBootstrap.cs

示例12: HookProcess

        public HookProcess(Process process, OverlayConfig overlayConfig, OverlayInterface overlayInterface)
        {
            if (HookManager.IsHooked(process.Id))
            {
                throw new ProcessAlreadyHookedException();
            }

            overlayInterface.ProcessID = process.Id;
            OverlayInterface = overlayInterface;

            Server = RemoteHooking.IpcCreateServer<OverlayInterface>(ref ChannelName, WellKnownObjectMode.Singleton, OverlayInterface);

            try
            {
                var libraryName = typeof (OverlayInterface).Assembly.GetName()
                                                           .Name + ".dll";
                var location = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, libraryName);
                RemoteHooking.Inject(process.Id, InjectionOptions.NoService | InjectionOptions.DoNotRequireStrongName, location, location, ChannelName, overlayConfig);
            }
            catch (Exception ex)
            {
                throw new InjectionFailedException(ex);
            }
            HookManager.AddHookedProcess(process.Id);
            InjectedProcess = process;
        }
开发者ID:Icehunter,项目名称:ffxivapp-hooker,代码行数:26,代码来源:HookProcess.cs

示例13: Setup

        public static void Setup()
        {
            // Reset the channel name.
            ChannelName = null;

            // Start an Ipc server for the DLL to connect to.
            InjectionServer = RemoteHooking.IpcCreateServer<ChatInterface>(ref ChannelName, WellKnownObjectMode.Singleton);
        }
开发者ID:bjorngylling,项目名称:Dota2Translator,代码行数:8,代码来源:InjectionHelper.cs

示例14: FormMain_Load

 private void FormMain_Load(object sender, EventArgs e)
 {
     channel = RemoteHooking.IpcCreateServer(
         ref channelName,
         WellKnownObjectMode.Singleton,
         IpcInterface,
         WellKnownSidType.WorldSid);
 }
开发者ID:ezhangle,项目名称:Easyhook,代码行数:8,代码来源:FormMain.cs

示例15: Form1_Load

        private void Form1_Load(object sender, EventArgs e)
        {
            // Initialise the IPC server
            ScreenshotServer = RemoteHooking.IpcCreateServer<ScreenshotInterface.ScreenshotInterface>(
                ref ChannelName,
                WellKnownObjectMode.Singleton);

            ScreenshotManager.OnScreenshotDebugMessage += new ScreenshotDebugMessage(ScreenshotManager_OnScreenshotDebugMessage);
        }
开发者ID:GodLesZ,项目名称:svn-dump,代码行数:9,代码来源:Form1.cs


注:本文中的System.Runtime.Remoting.Channels.Ipc.IpcServerChannel类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。