sources:
ReverserImplementation.cs (640 bytes)
Server.cs (1.1k)


website:
more info here
studies/corba/Corba-Code7/Server/Server.cs
download file

  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 {
 22     /// <summary>
 23     /// The server class registers itself at port 8421
 24     /// </summary>
 25     class Server
 26     {
 27         static void Main()
 28         {
 29             // reserve port 8421
 30             ChannelServices.RegisterChannel(new TcpServerChannel(8421));
 31
 32             // register the implementation (clients access it through the interface !)
 33             // using the URI "ReverserServer" and SingleCall activation
 34             RemotingConfiguration.RegisterWellKnownServiceType(typeof(ReverserImplementation), "ReverserServer",
 35                 WellKnownObjectMode.SingleCall)
;
 36
 37             // and wait for incoming requests ...
 38             Console.WriteLine("Server ready ... press Enter to terminate !");
 39             Console.ReadLine();
 40         }
 41     }
 42 }
 43