Home Help Center

Clients sometimes blocked to get the proxy of the server when using IceGrid

dorianleedorianlee Member dorian leeOrganization: pkeProject: passenger information display system
Hi, all

I'm using the IceGrid as the location service in my app, but I find that sometimes when I launched a client to connected to server, it will take a long time to resolve the proxy and get the result back.
After my debuging the client, I found that it will blocked for about 20 seconds at :
Ice::ObjectPrx svcBase = m_commPtr->stringToProxy("[email protected]");
m_proxy = ObjectPrx::checkedCast(svcBase) ;

but finally, it can get the proxy and finished the call, it occured often when I launch a client frequently in a short time.

My icegrid has only one node, and it has two services under this node, both of them running on the same PC

can someone give me suggestions? Thanks in advance.

Comments

  • dorianleedorianlee Member dorian leeOrganization: pkeProject: passenger information display system
    here is my config files

    config.AlarmService & config.ScadaService : my service app config files

    config.node1 : node config file

    application.xml & config.grid : my icegrid config files
  • dorianleedorianlee Member dorian leeOrganization: pkeProject: passenger information display system
    I've found the problem,but do not know how to resolve it.

    I've set the Ice Trace Properties and log the trace level messages.I found that:
    11/10/12 15:44:19.841 Locator: retrieved endpoints from locator, adding to locator table
       adapter = AlarmAdapter
       endpoints = tcp -h 192.168.1.117 -p 53890:tcp -h 192.168.122.1 -p 53890:
    -- 11/10/12 15:44:19.841 Network: trying to establish tcp connection to 192.168.122.1:53890
    -- 11/10/12 15:44:40.845 Network: failed to establish tcp connection
       local address: 0.0.0.0:5551
       remote address: 192.168.122.1:53890
       Network.cpp:1399: Ice::SocketException:
       socket exception: signal timeout .
    -- 11/10/12 15:44:40.845 Network: trying to establish tcp connection to 192.168.1.117:53890
    -- 11/10/12 15:44:40.845 Network: tcp connection established
    

    I do not understand why this endpoint ' tcp -h 192.168.122.1 -p 53890: ' is append to my real endpoint 'tcp -h 192.168.1.117 -p 53890', I do know how this endpoint comes out?
  • bernardbernard Jupiter, FLAdministrators, ZeroC Staff Bernard NormierOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    Hi Dorian,

    The computer where you run your server (and node1) has 2 network interfaces, one with address 192.168.1.117 and one with address 192.168.122.1.

    Currently, you configure this server to listen on both network interfaces, and more importantly to register both network interfaces with IceGrid as the endpoints for @ScadaAdapter and @AlarmAdapter proxies:
    <adapter name="DataPointSvcAdapter" id="ScadaAdapter" register-process="true" [B]endpoints="tcp"[/B]>
    ...
    
    <adapter name="AlarmSvcAdapter" id="AlarmAdapter" register-process="true" [B]endpoints="tcp"[/B]>
    

    tcp is equivalent to "tcp -h *" for object adapter endpoints.

    (side note: if you use a recent version of Ice, you don't need register-process)

    The solution is to add "-h <name or IP address>" to your endpoints, for example endpoints="tcp -h 192.168.1.117". This way, your server will only listen on this network interface, and will only register the corresponding endpoint with IceGrid.

    Best regards,
    Bernard
  • dorianleedorianlee Member dorian leeOrganization: pkeProject: passenger information display system
    bernard wrote: »
    Hi Dorian,

    The computer where you run your server (and node1) has 2 network interfaces, one with address 192.168.1.117 and one with address 192.168.122.1.

    Currently, you configure this server to listen on both network interfaces, and more importantly to register both network interfaces with IceGrid as the endpoints for @ScadaAdapter and @AlarmAdapter proxies:
    <adapter name="DataPointSvcAdapter" id="ScadaAdapter" register-process="true" [B]endpoints="tcp"[/B]>
    ...
    
    <adapter name="AlarmSvcAdapter" id="AlarmAdapter" register-process="true" [B]endpoints="tcp"[/B]>
    

    tcp is equivalent to "tcp -h *" for object adapter endpoints.

    (side note: if you use a recent version of Ice, you don't need register-process)

    The solution is to add "-h <name or IP address>" to your endpoints, for example endpoints="tcp -h 192.168.1.117". This way, your server will only listen on this network interface, and will only register the corresponding endpoint with IceGrid.

    Best regards,
    Bernard

    Hi Bernard,

    Thanks for your reply, it works fine after apply your solution, thanks a lot!!!!!:)

    Best Regards,

    Dorian lee
Sign In or Register to comment.