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"); }
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(); }