Archived

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

how to get client info from its request?

it looks like the information are all wrapped in the deeper level

can i get client info such as ip address from its request
i need to get the info from the interface of server

Comments

  • benoit
    benoit Rennes, France
    Hi,

    You can get this information with the con attribute of Ice::Current. This attribute points to the Ice::Connection object which represents the connection between the server and client. The toString() method of the Ice::Connection interface will allow you to get information about the connection.

    Cheers,
    Benoit.
  • yea i got the ip from current.con
    it's really convenient
    thanks :)
  • I have a similar question, but in the context of exceptions: if I have a proxy with multiple endpoints and a method call on that proxy throws, how do I find out from which endpoint the exception actually came from? (no, tracing is not an option)
  • bernard
    bernard Jupiter, FL
    Hi Mart,

    There is currently no way to get connection or endpoint information from an exception.

    Best regards,
    Bernard
  • Hello,

    Any plans to introduce this into some future version? Would be very userful in any at least moderately-sized environment.
  • benoit
    benoit Rennes, France
    Hi,

    We're discussing internally on whether or not to add a way to get this information and how it could be added. Could you perhaps tell us a little more on your need for this information? Is this for debugging purposes? Do you need it just for some local exceptions?

    Thanks!

    Cheers,
    Benoit.
  • The use case is quite simple: while having a bunch of boxes (let's say 10+) running the same service, it is very difficult to go hunting for the reason of a particular exception/failure when there is no hint about the source of the exception. It's not so much about feature debugging than about troubleshooting in production environment (one of the ICE services tends to lose DB connectivity now and then. which one?).
  • Hey-

    I would like to get the question derived a little bit under the same title.

    Is there a way in ICE to pull out the following from a client's request?
    (1) client id
    (2) timestamp

    Thanks!

    Y
  • benoit
    benoit Rennes, France
    Hi,

    Ice doesn't really have any "client ID" or timestamp for a request. It differentiates clients through their connection and requests with an ID. You can retrieve the client connection and request ID with the Ice::Current struct attribute passed to each invocation. See the Ice manual for more information on Ice::Current.

    Cheers,
    Benoit.
  • benoit wrote: »
    Hi,

    You can get this information with the con attribute of Ice::Current. This attribute points to the Ice::Connection object which represents the connection between the server and client. The toString() method of the Ice::Connection interface will allow you to get information about the connection.

    Cheers,
    Benoit.

    How about asynchronous calls? Is it possible to determine IP of entity responded to ICE async call?