Results 1 to 7 of 7

Thread: how to listen on 0.0.0.0 and register to registry?

  1. #1
    soloman817's Avatar
    soloman817 is offline Registered User
    Name: Zhang Xiang
    Organization: Self Employed
    Project: Dynamic Service Forward Gateway
    Join Date
    Jul 2004
    Location
    Shanghai, China
    Posts
    46

    how to listen on 0.0.0.0 and register to registry?

    hi, i have any problem now. I need to setup an adapter and listening on one port, if i set endpoints as "default -p xxxxx", it will auto search an ip(not 0.0.0.0) and listen, seems work well, but if I change the IP address, netstat shows that it still listen on old ip, and not work. but if i set endpoints as "default -h 0.0.0.0 -p xxxx", it resolve that problem, but rise new problem, that is: if i registry my object to icepackregistry, it will not work, and i use icepackadmin to find object, shows "MyObject:default -h 0.0.0.0 -p xxxx", so lookup service not work.

    how to resolve this problem? help plz.

  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
    If you set the adapter endpoint to "default -p <PORT> -h <IP address>" in the deployment descriptor -- that's what you should see in the registry after you deploy or update the application. If this doesn't work for you, could you provide more details on how to reproduce the problem?

    After starting your server, you can check the adapter endpoints with the "adapter endpoints <AdapterId>" IcePack admin command. Also, note that if you change the deployment descriptor, you need to update the deployment with "application update <descriptor.xml>".

    Benoit.

  3. #3
    soloman817's Avatar
    soloman817 is offline Registered User
    Name: Zhang Xiang
    Organization: Self Employed
    Project: Dynamic Service Forward Gateway
    Join Date
    Jul 2004
    Location
    Shanghai, China
    Posts
    46
    thanks for reply

    what i want to know is : How to set an adapter to listen on 0.0.0.0 so it can still work after people change the network interface ip, for you know, i start apache, netstat will show 0.0.0.0:80 listenning, not my ip like 10.0.0.42:80 listening. the way i thought is to use -h 0.0.0.0, but it cannot work on registry

  4. #4
    soloman817's Avatar
    soloman817 is offline Registered User
    Name: Zhang Xiang
    Organization: Self Employed
    Project: Dynamic Service Forward Gateway
    Join Date
    Jul 2004
    Location
    Shanghai, China
    Posts
    46
    more detail,
    for example, i have an computer which has two interface : eth0 and eth1
    eth0 is set to 10.0.0.42
    eth1 is set to 192.168.0.42
    if i use default -p 20000
    netstat show:
    10.0.0.42:20000 listenning
    so, it cannot work on 192.168.0.42
    apache will be:
    0.0.0.0:80 listenning
    what i want to know is how to do like apache does, and still work on registry

  5. #5
    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
    I'm afraid that's not possible. If the object adapter endpoint IP address is 0.0.0.0 (to listen on all the interfaces) then that's what will get registered in the registry. Ice can't figure out the IP addresses of all the interfaces the object adapter will be listening on when you specify 0.0.0.0.

    If you want to listen on multiple interfaces, it's better to use multiple endpoints, for example: "default -p 12000 -h 192.168.0.1:default -p 12000 -h 10.0.0.1".

    Benoit.

  6. #6
    soloman817's Avatar
    soloman817 is offline Registered User
    Name: Zhang Xiang
    Organization: Self Employed
    Project: Dynamic Service Forward Gateway
    Join Date
    Jul 2004
    Location
    Shanghai, China
    Posts
    46
    Quote Originally Posted by benoit
    I'm afraid that's not possible. If the object adapter endpoint IP address is 0.0.0.0 (to listen on all the interfaces) then that's what will get registered in the registry. Ice can't figure out the IP addresses of all the interfaces the object adapter will be listening on when you specify 0.0.0.0.

    If you want to listen on multiple interfaces, it's better to use multiple endpoints, for example: "default -p 12000 -h 192.168.0.1:default -p 12000 -h 10.0.0.1".

    Benoit.
    your answer is reasonable, for if one adapter change it's ip without re-register in the registry, registry didn't know where to find the adapter. but multiple endpoints is not so convinenble, any good solution? need a program to listen for the event for ip changing, and if found , re-register on the reigstry? is this the best way?

  7. #7
    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
    I'm not quite sure I understand your question.

    If the IP address of an interface changes, you'll need to update the IcePack registry with the new IP address. Another solution is to not use IP addresses for endpoints but instead use hostnames (specified in /etc/hosts or a DNS server). This way you won't have to update the IcePack registry (you'll have to update the /etc/hosts file though!).

    For example, if your host has 2 interfaces eth0 and eth1, you could assign a hostname for each interface:

    Code:
    /etc/hosts:
    
      192.168.0.1 myhost-eth0
      10.0.0.1 myhost-eth1
    The adapter endpoint would be: "default -p 12000 -h myhost-eth0:default -p 12000 -h myhost-eth1".

    Btw, for more information about the use of 0.0.0.0 (aka INADDR_ANY) in object adapter endpoints, you can also check this thread.

    Let me know if this still doesn't answer your question!

    Benoit.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Registry Crash
    By ctennis in forum Bug Reports
    Replies: 2
    Last Post: 04-19-2007, 01:31 PM
  2. Replies: 2
    Last Post: 06-01-2006, 11:21 AM
  3. Unable to register object in icepack registry
    By annekat in forum Help Center
    Replies: 2
    Last Post: 11-26-2004, 06:01 PM
  4. Replies: 9
    Last Post: 11-15-2004, 07:30 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
  •