Example #1
0
 public ClientDaemon(ConnectionPack cp, bool fullLog)
 {
     remoteDaemon = (DaemonRemoteServerObject)Activator.GetObject(
         typeof(DaemonRemoteServerObject),
         "tcp://" + cp.Ip + ":" + cp.Port + "/DaemonRemoteServerObject");
     remoteDaemon.fullLog(fullLog);
     //TODO if (remoteDaemon == null) throw new SocketException();
 }
Example #2
0
        static void Main(string[] args)
        {
            ServerDaemon sd = ServerDaemon.Instance;

            channel = new TcpChannel(port);
            ChannelServices.RegisterChannel(channel, false);

            myServerObj = new DaemonRemoteServerObject();
            RemotingServices.Marshal(myServerObj, "DaemonRemoteServerObject", typeof(DaemonRemoteServerObject));

            System.Console.WriteLine("Daemon Server Online : port: " + port);
//			System.Console.WriteLine("<enter> para sair...");
            System.Console.WriteLine("<ctrl+c> para sair...");

            System.Console.ReadLine();

            Console.ForegroundColor = ConsoleColor.Red;
            System.Console.WriteLine("Daemon Server is going OFFLINE");
            Console.ResetColor();
            Thread.Sleep(1000); //Ensuring everything is offline
        }