1 // ////////////////////////////////////////////////////////
2 // Lecture on the CORBA Component Model, summer term 2003
3 // Assignment 7, Stephan Brumme, 702544
4 //
5 // Microsoft .NET server that exports a "reverse" operation
6 //
7
8 // for console output
9 using System;
10
11 // remoting
12 using System.Runtime.Remoting;
13 using System.Runtime.Remoting.Channels;
14 using System.Runtime.Remoting.Channels.Tcp;
15
16 // reverse operation
17 using ReverseAPI;
18
19
20 namespace Aufgabe7
{
21 /// <summary>
22 /// The server class registers itself at port 8421
23 /// </summary>
24 class Server
{
25 static void Main()
26 {
27 // reserve port 8421
28 ChannelServices.RegisterChannel(new TcpServerChannel(8421));
29
30 // register the implementation (clients access it through the interface !)
31 // using the URI "ReverserServer" and SingleCall activation
32 RemotingConfiguration.RegisterWellKnownServiceType(typeof(ReverserImplementation), "ReverserServer",
33 WellKnownObjectMode.SingleCall);
34
35 // and wait for incoming requests ...
36 Console.WriteLine("Server ready ... press Enter to terminate !");
37 Console.ReadLine();
38 }
39 }
40 }
41