users@grizzly.java.net

Re: Determining the client IP

From: Alan Williamson <alan_at_blog-city.com>
Date: Tue, 27 Nov 2007 22:48:55 +0000

>> Am i looking for it in the right place? If not, then where?
>
> OK that one is a little tricky (and docs completely missing). By
> default, we aren't setting those variables to avoid IO level call. So
> what you need to add is:
>
> request.action(ActionCode.ACTION_REQ_HOST_ADDR_ATTRIBUTE);
> request.action(ActionCode.ACTION_REQ_LOCAL_NAME_ATTRIBUTE);
> request.action(ActionCode.ACTION_REQ_HOST_ATTRIBUTE);
> request.action(ActionCode.ACTION_REQ_LOCAL_ADDR_ATTRIBUTE);
>
> and then invoke the method you described above.
>
> Let me know if that doesn't work.

Once again, Grizzly when looks down, picks itself up and dusts itself off!

Perfect. I only need the remote host. I had to pass in a null param,
as there wasn't a signature matching the one you indicated.

    request.action(ActionCode.ACTION_REQ_HOST_ADDR_ATTRIBUTE, null);


Well, i think thats me done with all the questions for Tuesday! ;)

Thank you Jeanfrancois, appreciate the fast response.

-- 
Alan Williamson
  "a wiki -and- a blog" @ http://www.Blog-City.com/
  b: http://alan.blog-city.com/