Ejemplo n.º 1
0
    public static void Main()
    {
        Ice.IceClientChannel icc = new Ice.IceClientChannel();
        ChannelServices.RegisterChannel(icc);

        Hello h = (Hello)Activator.GetObject(typeof(Hello), "ice://localhost:10000/hello");

        string[] ids = h.ice_ids();
        foreach (string id in ids)
        {
            Console.WriteLine(id);
        }

        helloDelegate hd = new helloDelegate(h.sayHello);

        string[]     who = { ".NET", "Mono", "C#" };
        IAsyncResult ar  = hd.BeginInvoke(who, null, null);

        Console.WriteLine("Waiting");
        ar.AsyncWaitHandle.WaitOne();
        int ret = hd.EndInvoke(ar);

        //    int ret = h.sayHello(who);
        Console.WriteLine("Said " + ret + " hellos.");
    }
Ejemplo n.º 2
0
  public static void Main () {
    Ice.IceClientChannel icc = new Ice.IceClientChannel ();
    ChannelServices.RegisterChannel (icc);

    Hello h = (Hello) Activator.GetObject (typeof (Hello), "ice://localhost:10000/hello");

    string[] ids = h.ice_ids();
    foreach (string id in ids) {
      Console.WriteLine (id);
    }

    helloDelegate hd = new helloDelegate (h.sayHello);

    string[] who = {".NET", "Mono", "C#"};
    IAsyncResult ar = hd.BeginInvoke (who, null, null);
    Console.WriteLine ("Waiting");
    ar.AsyncWaitHandle.WaitOne();
    int ret = hd.EndInvoke (ar);
    //    int ret = h.sayHello(who);
    Console.WriteLine ("Said " + ret + " hellos.");
  }
Ejemplo n.º 3
0
        static void Main(string[] args)
        {
            helloDelegate delegat = new helloDelegate(hello);

            delegat("hello from delegate");
        }