// Collection of code snippets by Arne Vajhøj // (from articles on eksperten.dk / vajhoej.dk written sometime between 2004 and now) using System; using System.Runtime.Remoting; using System.Runtime.Remoting.Channels; using Ch.Elca.Iiop; using corbatest.common; namespace CorbaTest.Server { public class TestImpl : MarshalByRefObject, Test { private int counter; public int add(int a, int b) { return a + b; } public String dup(String s) { return s + s; } public Data process(Data d) { return new Data(d.iv + 1, d.sv + "X"); } public int getCounter() { counter++; return counter; } public void noop() { // nothing } } public class Program { private const int SERVER_PORT = 12345; private const string NAME = "TestN"; public static void Main(string[] args) { ChannelServices.RegisterChannel(new IiopChannel(SERVER_PORT), false); RemotingServices.Marshal(new TestImpl(), NAME); Console.ReadKey(); } } }