using System;
using System.Collections.Generic;
using System.Text;

using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Channels.Tcp;
using SharedLibrary;

namespace TcpRemoting
{
   class Program
   {
      static void Main(string[] args)
      {
         TcpChannel tcp = new TcpChannel(8080);
         ChannelServices.RegisterChannel(tcp, false);

         RemotingConfiguration.RegisterWellKnownServiceType(
            typeof(ISharedObject),
            "SharedObject.rem", WellKnownObjectMode.Singleton);

         Console.WriteLine("Host zdalny został uruchomiony. Naciśnij [Enter] by zakończyć.");
         Console.ReadLine();
      }
   }
}
