Results 1 to 6 of 6

Thread: passing a proxy created using localhost as part of the proxy string

  1. #1
    halfhp is offline Registered User
    Name: Nick Fellows
    Organization: Aoptix
    Project: optical comms appliance
    Join Date
    Oct 2009
    Posts
    31

    passing a proxy created using localhost as part of the proxy string

    If I create a proxy of an object in a process running on computer A using localhost as the host parameter passed to stringToProxy(getRemoteProxyString(...)) and pass that proxy as a parameter to a process on computer B, will that proxy be usable by processes on computer B? Or do I need to explicitly declare which interface I want to make the object available on? If so, what if I want to make the object available across multiple or all interfaces?

    Thanks,
    Nick

  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,

    I'm not sure what you're trying to achieve. Can you detail it a bit more? Why do you want to pass proxies as strings? This is most of the time bad practice. You should pass proxies as proxies instead . For an example, see the demo/Ice/callback demo from your Ice distribution.

    Cheers,
    Benoit.

  3. #3
    halfhp is offline Registered User
    Name: Nick Fellows
    Organization: Aoptix
    Project: optical comms appliance
    Join Date
    Oct 2009
    Posts
    31
    Hi Benoit,

    I don't want to pass proxies as strings - apologies if my initial post was vague. My question is actually bout the proxy objects that I am passing and whether or not the string I use to create them affects one's ability to use them remotely.

    I have a series of processes that use Ice to communicate. Everything works great when all of the processes are colocated on one computer. When I move one of the processes to another computer however, it breaks any methods I have which pass proxies around. This question comes from me theorizing that when creating a proxy of a local ice instance via stringtoproxy using "127.0.0.1" as part of the string causes that instance to be bound to the loopback interface and thus unusable by the outside world.

  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,

    Ok, I see. If you create proxies using the 127.0.0.1 address then yes that is also what will be passed to other Ice applications when passing the result of stringToProxy. The stringToProxy method doesn't have any magic to transform addresses or any other components of the stringified proxy: it is a simple transform of the string to a programatic Ice proxy object.

    I wonder why you need to create proxies from strings however. This should be mostly needed for a small number of proxies, typically for configurable proxies (stored in a text configuration file). Usually proxies are then obtained when servants are registered with the Ice object adapter (the add or addWithUUID methods return a proxy). You can also create proxies using the createProxy method of the Ice object adapter. The proxies returned by those methods contain the endpoints of the object adapter (configured with the object adapter Endpoints property).

    Cheers,
    Benoit.

  5. #5
    halfhp is offline Registered User
    Name: Nick Fellows
    Organization: Aoptix
    Project: optical comms appliance
    Join Date
    Oct 2009
    Posts
    31
    That sounds like my problem then. I don't have a good understanding of what Ice does behind the scenes and was naively expecting that the process of obtaining a proxy from a string simply told the ice runtime who to talk to in order to retrieve the proxy...I did't realize that it actually just create the proxy on the spot with a hardcoded endpoint. (I assumed that the process of passing by proxy resulted in the proxy being configured at the time of sending with endpoint info corresponding to whichever interface the proxy was sent out over.)

    At the time the original code was written, wet had abou 7 ice objects with one instance each that needed to be proxied and up until now they all lived together on one system. Hardcoding the strings seemed like the most straightforward solution.

    One final question: If one is using Ice on a system with multiple interfaces (we have 4) and one creates a new proxy using the createProxy method, will the resulting proxy be passable to any of the ice environments living on the other side of those interfaces? Just to clarify - by interface I mean a physical network card which has it's own entries in the computer's routing table which cannot be reached via the other interfaces.

  6. #6
    bernard's Avatar
    bernard is offline ZeroC Staff
    Name: Bernard Normier
    Organization: ZeroC, Inc.
    Project: Ice
    Join Date
    Feb 2003
    Location
    Palm Beach Gardens, FL
    Posts
    1,294
    Hi Nick,

    You can find a lot of information about proxies in this Proxies article (perhaps too much information!).

    A proxy just encapsulates information on how to reach a remote object. Creating a proxy or passing a proxy through an operation is a cheap local call that does not trigger any connection establishment or remote processing.

    One final question: If one is using Ice on a system with multiple interfaces (we have 4) and one creates a new proxy using the createProxy method, will the resulting proxy be passable to any of the ice environments living on the other side of those interfaces? Just to clarify - by interface I mean a physical network card which has it's own entries in the computer's routing table which cannot be reached via the other interfaces.
    This all depends on your object adapter configuration, adapter.Endpoints and adapter.PublishedEndpoints

    See "32.4.6 Endpoints" in Object Adapters

    Best regards,
    Bernard
    Bernard Normier
    ZeroC, Inc.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Invalid proxy
    By sirkal in forum Help Center
    Replies: 4
    Last Post: 02-18-2011, 09:52 AM
  2. ICE creates localhost to localhost connections
    By nefilim in forum Help Center
    Replies: 2
    Last Post: 01-13-2009, 04:59 PM
  3. Getting a description of proxy
    By Nis Baggesen in forum Help Center
    Replies: 2
    Last Post: 06-01-2005, 08:03 AM
  4. Multiple Hosts in proxy string ???
    By DeepDiver in forum Help Center
    Replies: 2
    Last Post: 04-20-2005, 11:51 AM
  5. Proxy to 127.0.0.1
    By Nis Baggesen in forum Help Center
    Replies: 3
    Last Post: 02-16-2005, 04:04 PM

Posting Permissions

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