Exemple #1
0
        protected void InitFirstInstance(int port, ActivateApp activator)
        {
            IpcChannel serverChannel = new IpcChannel("localhost" + ":" + port);

            ChannelServices.RegisterChannel(serverChannel, false);

            //init and publish remote singletone object
            _Single           = new RemoteSingleInstance();
            _Single.Activator = activator;
            RemotingServices.Marshal(_Single, "RemoteObject.rem");
        }
Exemple #2
0
        protected void ActivateFirstInstance(int port)
        {
            IpcChannel channel = new IpcChannel();

            // Register the channel.
            ChannelServices.RegisterChannel(channel, false);

            // Create an instance of the remote object.
            RemoteSingleInstance service = (RemoteSingleInstance)Activator.GetObject(
                typeof(RemoteSingleInstance),
                "ipc://localhost:" + port + "/RemoteObject.rem");

            service.ActivateApp();
        }