Ejemplo n.º 1
0
    public static void Main(string[] args)
    {
        Node n = BuildExpr();

        if (args.Length != 1)
        {
            Console.WriteLine("Specify 'server' or 'client' as first argument");
            return;
        }

        if (args[0] == "client")
        {
            Ice.IceClientChannel ic = new Ice.IceClientChannel();
            ChannelServices.RegisterChannel(ic);

            NodeEvaluator ne = (NodeEvaluator)Activator.GetObject(typeof(NodeEvaluator),
                                                                  "ice://localhost:10000/ne");

            int res = ne.EvalNode(n);
            Console.WriteLine("Result: {0}", res);
        }
        else if (args[0] == "server")
        {
            Ice.IceChannel ic = new Ice.IceChannel(10000);
            ChannelServices.RegisterChannel(ic);

            RemotingConfiguration.RegisterWellKnownServiceType(typeof(NodeEvaluatorI),
                                                               "ne",
                                                               WellKnownObjectMode.Singleton);
            Console.ReadLine();
        }
    }
Ejemplo n.º 2
0
  public static void Main () {
    Ice.IceChannel ic = new Ice.IceChannel ();
    ChannelServices.RegisterChannel (ic);

    HelloDispatcher hd = (HelloDispatcher) Activator.GetObject (typeof (HelloDispatcher), "ice://localhost:10000/hellodispatcher");

    HelloReceiverI hr = new HelloReceiverI();
    RemotingServices.Marshal (hr, "asdf");
    hd.tellHello (hr, "proxying");
  }
Ejemplo n.º 3
0
  public static void Main () {
    Ice.IceChannel ics = new Ice.IceChannel (10000);
    ChannelServices.RegisterChannel (ics);

    RemotingConfiguration.RegisterWellKnownServiceType (typeof (HelloDispatcherI),
							"hellodispatcher",
							WellKnownObjectMode.Singleton);

    Console.ReadLine();
  }
Ejemplo n.º 4
0
    public static void Main()
    {
        Ice.IceChannel ics = new Ice.IceChannel(10000);
        ChannelServices.RegisterChannel(ics);

        RemotingConfiguration.RegisterWellKnownServiceType(typeof(HelloDispatcherI),
                                                           "hellodispatcher",
                                                           WellKnownObjectMode.Singleton);

        Console.ReadLine();
    }
Ejemplo n.º 5
0
    public static void Main()
    {
        Ice.IceChannel ic = new Ice.IceChannel();
        ChannelServices.RegisterChannel(ic);

        HelloDispatcher hd = (HelloDispatcher)Activator.GetObject(typeof(HelloDispatcher), "ice://localhost:10000/hellodispatcher");

        HelloReceiverI hr = new HelloReceiverI();

        RemotingServices.Marshal(hr, "asdf");
        hd.tellHello(hr, "proxying");
    }
Ejemplo n.º 6
0
  public static void Main (string[] args) {
    Node n = BuildExpr();

    if (args.Length != 1) {
      Console.WriteLine ("Specify 'server' or 'client' as first argument");
      return;
    }

    if (args[0] == "client") {
      Ice.IceClientChannel ic = new Ice.IceClientChannel();
      ChannelServices.RegisterChannel (ic);

      NodeEvaluator ne = (NodeEvaluator) Activator.GetObject (typeof (NodeEvaluator),
							      "ice://localhost:10000/ne");

      int res = ne.EvalNode (n);
      Console.WriteLine ("Result: {0}", res);
    } else if (args[0] == "server") {
      Ice.IceChannel ic = new Ice.IceChannel(10000);
      ChannelServices.RegisterChannel (ic);

      RemotingConfiguration.RegisterWellKnownServiceType (typeof (NodeEvaluatorI),
							  "ne",
							  WellKnownObjectMode.Singleton);
      Console.ReadLine();
    }
  }