Results 1 to 4 of 4

Thread: IceTouch and IceGrid

  1. #1
    pencil is offline Registered User
    Name: Daniel Adam
    Organization: Technische Univeristaet Muenchen
    Project: Communication framework for iPhone
    Join Date
    Dec 2011
    Posts
    2

    IceTouch and IceGrid

    Dear all,

    I want to connect a iOS App with a IceGrid Application, but first I have some problems with the connection. And second I can't found any other projects or sample for this use.

    I changed the IceTouch and the objc Hello Example to connect to the IceGrid/Simple-Example, but with no success.

    I hope anybody can me get the one significant hint.

    I looking for your answers.

    Thanks

    Pencil

  2. #2
    benoit's Avatar
    benoit is offline ZeroC Staff
    Name: Benoit Foucher
    Organization: ZeroC, Inc.
    Project: Ice
    Join Date
    Feb 2003
    Location
    Rennes, France
    Posts
    2,196
    Hi,

    You can try it out by doing the following changes:

    • change the IceGrid simple demo to support the same Hello interface as the hello demo. For that, you need to add the "int delay" parameter to the sayHello method of the Hello interface defined in demo/IceGrid/simple/Hello.ice. You will also need to modify the HelloI.h and HelloI.cpp files to add this parameter to the servant implementation. Re-compile the demo and run IceGrid with the following command from the demo/Icegrid/simple directory:
      Code:
        $ icegridnode --Ice.Config=config.grid --deploy application.xml
    • change the iPhone hello client to lookup for the hello object using IceGrid. For this, you can for example change the client createProxy method defined in /Developer/Examples/IceTouch-1.2.0/iPhone/hello/Classes/HelloController.m to the following:

      Code:
      -(id<DemoHelloPrx>)createProxy
      {
          NSString* s;
      	int deliveryMode = [modePicker selectedRowInComponent:0];
      	if(deliveryMode == DeliveryModeTwowayAccessory || deliveryMode == DeliveryModeOnewayAccessory || deliveryMode == DeliveryModeOnewayAccessoryBatch)
      	{
      		s = @"hello:accessory -p com.zeroc.helloWorld";
      	}
      	else
      	{
      		s = @"hello"; // Use "hello" well-known proxy for the hello proxy.
      	}
      
      
          NSString* locatorS = [NSString stringWithFormat:@"DemoIceGrid/Locator:tcp -h %@ -p 4061",
                                hostnameTextField.text, hostnameTextField.text, hostnameTextField.text];
          
          [[NSUserDefaults standardUserDefaults] setObject:hostnameTextField.text forKey:hostnameKey];
      
          ICEObjectPrx* prx = [communicator stringToProxy:s];
          prx = [prx ice_locator:[ICELocatorPrx uncheckedCast:[communicator stringToProxy:locatorS]]];
          
          switch(deliveryMode)
          ...
      The code above specifies a locator proxy on the hello proxy. You could also define the Ice locator using the Ice.Default.Locator property.

    Cheers,
    Benoit.

  3. #3
    pencil is offline Registered User
    Name: Daniel Adam
    Organization: Technische Univeristaet Muenchen
    Project: Communication framework for iPhone
    Join Date
    Dec 2011
    Posts
    2
    Thanks, for the delay. Your post was the right solution.

    Now, I have a further question: I want to apply the singleton pattern for the proxy, but with objective-c I always get a EXC_BAD_ACCESS. After different tests, I think the ICECommunicator is the problem. Can you approve this behavior?

  4. #4
    benoit's Avatar
    benoit is offline ZeroC Staff
    Name: Benoit Foucher
    Organization: ZeroC, Inc.
    Project: Ice
    Join Date
    Feb 2003
    Location
    Rennes, France
    Posts
    2,196
    Hi,

    If nothing else retains the communicator object during the lifetime of your application, yes, it's quite possible this is the problem. We'll discuss whether or not the proxy should retain the communicator to prevent this.

    Cheers,
    Benoit.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. IceTouch Server on iPhone
    By Janggwan in forum Help Center
    Replies: 1
    Last Post: 11-09-2010, 06:24 AM
  2. Some more errors with IceTouch
    By tote in forum Help Center
    Replies: 0
    Last Post: 07-22-2010, 07:02 PM
  3. Installing IceTouch-1.0.0 on MacOSX
    By tote in forum Help Center
    Replies: 2
    Last Post: 07-19-2010, 12:58 PM
  4. iPhone OS 3 and IceTouch
    By uwe.arzt in forum Help Center
    Replies: 3
    Last Post: 05-21-2009, 06:59 AM
  5. IceTouch : Can't specify adapter endpoints
    By Matthieu in forum Help Center
    Replies: 2
    Last Post: 03-10-2009, 09:08 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •