// 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 System.Runtime.Remoting.Channels.Tcp; // server klasse class Server2 { public static void Main(string[] args) { // registrere channel ChannelServices.RegisterChannel(new TcpServerChannel(50000)); // registrere well known type for singleton RemotingConfiguration.RegisterWellKnownServiceType(typeof(Calc), "Calc", WellKnownObjectMode.Singleton); Console.Write("Press enter to exit"); Console.ReadLine(); } }