Archived

This forum has been archived. Please start a new discussion on GitHub.

use Icegrid on PC server and IceE for Pocket Pc client

Dear,
I'd like to use Icegrid on my PC server and IceE for my Pocket Pc client. the goal is to make load-balancing between several server. Is it possible ? if yes, what do I change in the code of client in the demo sample code ?
Thanks

Comments

  • dwayne
    dwayne St. John's, Newfoundland
    Yes, it should be possible to use Ice-E clients with IceGrid. However the IceGrid Slice is not compiled by default in Ice-E. Therefore you will have to compile the IceGrid Slice yourself with the Ice-E Slice compiler and then either create a library from the compiled generated files or link them directly into your client application. Also you will have to make sure that Ice-E was built with locator support enabled.
  • I try to compile IceGrid slice using Ice-E slice compiler : I use the IceGrid slice directory of Ice for this but I have some errors when I tryed to generate a library from the compiled generated files in:
    IceGrid/Session.h like: "Glacier2: The symbol to the left of :: must be a type ..."
    This file include Glacier2/Session.h. When I deactivate the line below in this include file:
    #ifndef _Session_h__
    the error disappears but It's generate an other error (same error) in the Registry.h file.

    Is someone have an idea ?
    Many Thanks
  • dwayne
    dwayne St. John's, Newfoundland
    What features of IceGrid are you planning on using? If you are just going to use it for it's simple Locator feature then it will not actually be necessary to compile the IceGrid slice. You just need to set the Ice.Default.Locator property and make sure Locator support is enabled in Ice-E (which it is by default). For example something like:
    Ice.Default.Locator=DemoIceGrid/Locator:default -p 4061
    
    However, if you want to use some of the other features of IceGrid then it will be necessary to compile some of the IceGrid slice, which as you have seen, offers some issues because of all the other slice files included by the IceGrid slice.
  • I'd like to :
    -attempt locate request to a server location
    - deactivate proxy cache and set timeout to cache locator in order to make load balancing over several server.

    see in the section below the content of my config.txt file for Pocket Pc client :

    # The IceGrid locator proxy.
    #
    Ice.Default.Locator=DemoIceGrid/Locator:default -h 192.168.0.1 -p 12000:default -h 192.168.0.1 -p 12001:default -h 192.168.0.1 -p 12002
    
    Ice.Override.Timeout=10000
    
    #
    # Trace properties.
    #
    #Ice.Trace.Network=1
    Ice.Trace.Locator=1
    
    #
    # IceGrid admin properties to allow running IceGrid admin clients.
    #
    IceGridAdmin.Username=benoit
    IceGridAdmin.Password=dummy
    
    

    I already enabled Locator support in Ice-E (default configuration)

    Many thanks
  • dwayne
    dwayne St. John's, Newfoundland
    prettyMan wrote: »
    I'd like to :
    - attempt locate request to a server location
    - deactivate proxy cache and set timeout to cache locator in order to make load balancing over several server.

    Ok, it is not necessary to compile IceGrid slice to just use locator feature. However, Ice-E currently does not support the setting of the locator cache timeout. You will still get some load balancing without this as even though a single proxy will continue to use the same server, different clients will use different servers.
    prettyMan wrote: »
    see in the section below the content of my config.txt file for Pocket Pc client :
    # The IceGrid locator proxy.
    #
    Ice.Default.Locator=DemoIceGrid/Locator:default -h 192.168.0.1 -p 12000:default -h 192.168.0.1 -p 12001:default -h 192.168.0.1 -p 12002
    
    Ice.Override.Timeout=10000
    
    #
    # Trace properties.
    #
    #Ice.Trace.Network=1
    Ice.Trace.Locator=1
    
    #
    # IceGrid admin properties to allow running IceGrid admin clients.
    #
    IceGridAdmin.Username=benoit
    IceGridAdmin.Password=dummy
    
    

    I already enabled Locator support in Ice-E (default configuration)

    Many thanks

    From your configuration you appear to have three IceGrid registries running. While there is no reason that an Ice-E client cannot work with replicated IceGrid registries, it would probably be better to start off with a single registry with multiple servers configured on a single node. After that is working you can then add multiple nodes and, if necessary, multiple registries.

    Also, there is no need to set IceGridAdmin properties in the client that is just using locator feature.

    Have you tried using locator with Ice-E client yet? If so what is the problem that you are seeing?
  • yes, I have. It's work fine on the desktop IceE client (client and server on the same PC). I use the same program. On Pocket Pc, The problem is at this line :
    "initData.properties->load("\\My Documents\\Personal\\iceClient\\config.txt");" 
    

    because it's shown a messageBox in the catch "Loading problem".

    below is the client code:
    DataInfo::dataDistantPrx run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator)
    {
       Ice::ObjectPrx obj = communicator->stringToProxy("dataInfo_");
       DataInfo::dataDistantPrx parcPrx_ = DataInfo::dataDistantPrx::checkedCast(obj->ice_twoway()->ice_timeout(10000));
        
    	return parcPrx_;
    }
    
    
    DataInfo::dataDistantPrx initComm()
    {
    	DataInfo::dataDistantPrx parcPrx ;
    
        try
        {
            int argc = 0;
            Ice::InitializationData initData;
            initData.properties = Ice::createProperties();
    
            #ifndef _WIN32_WCE
    		string config = "d:/these/developpement/ARSigUbiq/config/config.client";
            #endif
    
    	  try
            {
    	     initData.properties->load("\\My Documents\\Personal\\iceClient\\config.txt");
    			
            }
            catch(const Ice::FileException&)
            {
    	     MessageBox(NULL, TEXT("loading problem !"), TEXT("Error"), MB_OK);
            }
    
            communicator = Ice::initialize(argc, 0, initData);
    
            parcPrx = run(argc, 0, communicator);
    		
            if(!parcPrx)
            {
                MessageBox(NULL, TEXT("invalid proxy"), TEXT("Information"), MB_ICONEXCLAMATION | MB_OK);
                //return EXIT_FAILURE;
            }
            return parcPrx ;
    		
        }
        catch(const Ice::Exception& ex)
        {
            TCHAR wtext[1024];
            
    	MessageBox(NULL, TEXT("problem 2 !"), TEXT("Error"), MB_ICONEXCLAMATION | MB_OK);
        }
    
    }
    
    int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine,int nCmdShow)
    {
    	//create window
    	...
    	DataInfo::dataDistantPrx proxyParc ;
    
    	proxyParc = initComm();
    	if(!proxyParc)
    		MessageBox(ghWnd,TEXT("error 1!"),TEXT("info"), MB_OK);
    	else
    		MessageBox(ghWnd,TEXT(" OK !"),TEXT("info"), MB_OK);
        .....
    }
    
    
    
  • dwayne
    dwayne St. John's, Newfoundland
    We will look into the issue with the config file on Pocket PC. In the meantime you can set your properties programatically.
    initData.properties->setProperty("Ice.Default.Locator", "...");